Ejemplo n.º 1
0
    def test_get_all_lines(self):
        base = 'hello\nworld\nthis\nis\na\ntest'
        SRC = SourceString(base)

        lines = [str(x) for x in SRC.get_all_lines()]
        expected = ['1   |hello\n', '2   |world\n', '3   |this\n', '4   |is\n',
            '5   |a\n', '6   |test']
        assert lines == expected
        lines = ''.join([repr(x) for x in SRC.get_all_lines()])
        assert lines == base