Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_filter_lines_one_group(self):
lines = ['1: foo', '12: bar', '', 'Debug: info']
self.assertEqual(
['1', '12'],
list(utils.filter_lines(lines,
r'(?P
def test_filter_lines_no_groups(self):
lines = ['a', 'b', 'c', 'ad']
self.assertEqual(lines, list(utils.filter_lines(lines, '.')))
self.assertEqual(['a', 'ad'], list(utils.filter_lines(lines, 'a')))
self.assertEqual(['ad'], list(utils.filter_lines(lines, '.d')))
self.assertEqual(['ad'], list(utils.filter_lines(lines, 'd')))
self.assertEqual([], list(utils.filter_lines(lines, '^d')))
self.assertEqual([], list(utils.filter_lines(lines, 'foo')))
def test_filter_lines_no_groups(self):
lines = ['a', 'b', 'c', 'ad']
self.assertEqual(lines, list(utils.filter_lines(lines, '.')))
self.assertEqual(['a', 'ad'], list(utils.filter_lines(lines, 'a')))
self.assertEqual(['ad'], list(utils.filter_lines(lines, '.d')))
self.assertEqual(['ad'], list(utils.filter_lines(lines, 'd')))
self.assertEqual([], list(utils.filter_lines(lines, '^d')))
self.assertEqual([], list(utils.filter_lines(lines, 'foo')))
def test_filter_lines_many_groups(self):
lines = ['1: foo', '12: bar', '', 'Debug: info']
self.assertEqual(
[('1', 'foo'), ('12', 'bar')],
list(utils.filter_lines(lines,
r'(?P