def test_two_liner(self): source = [(0, 'First line'), (0, 'Second line')] expected = [(0, ['First line', 'Second line'])] actual = gather_lines(source) self.assertEqual(actual, expected)
def test_dedented_separated_multi_lines(self): source = [(4, 'First line'), (4, 'Second line'), (4, ''), (0, 'Fourth line'), (0, 'Fifth line')] expected = [(4, ['First line', 'Second line', '']), (0, ['Fourth line', 'Fifth line'])] actual = gather_lines(source) self.assertEqual(actual, expected)
def test_dedented_lines(self): source = [(4, 'First line'), (0, 'Second line')] expected = [(4, ['First line']), (0, ['Second line'])] actual = gather_lines(source) self.assertEqual(actual, expected)
def test_separated_lines(self): source = [(0, 'First line'), (0, ''), (0, 'Third line')] expected = [(0, ['First line', '']), (0, ['Third line'])] actual = gather_lines(source) self.assertEqual(actual, expected)
def test_indented_multi_lines(self): source = [(0, 'First line'), (0, 'Second line'), (4, 'Third line'), (4, 'Fourth line')] expected = [(0, ['First line', 'Second line']), (4, ['Third line', 'Fourth line'])] actual = gather_lines(source) self.assertEqual(actual, expected)
def test_separated_multi_lines(self): source = [(0, 'First line'), (0, 'Second line'), (0, ''), (0, 'Fourth line'), (0, 'Fifth line')] expected = [(0, ['First line', 'Second line', '']), (0, ['Fourth line', 'Fifth line'])] actual = gather_lines(source) self.assertEqual(actual, expected)
def test_one_liner(self): source = [(0, 'One liner')] expected = [(0, ['One liner'])] actual = gather_lines(source) self.assertEqual(actual, expected)
def test_empty(self): source = [] expected = [] actual = gather_lines(source) self.assertEqual(actual, expected)