def test_multiline(): path = os.path.join(_basepath, 'multi_line_comment.py') src = Source(path) sections = list(src.read_sections()) assert len(sections) == 1 assert sections[0][0] == ''.join([ '\n', 'This is a multiline comment.\n', 'The total line comment length is 4 lines.\n', '\n'])
def test_multiline_unmatched(): path = os.path.join(_basepath, 'multi_line_unmatched.py') src = Source(path) sections = list(src.read_sections()) return sections
def test_multiline_hidden(): path = os.path.join(_basepath, 'multi_line_comment_hidden.py') src = Source(path) sections = list(src.read_sections()) assert len(sections) == 1 assert sections[0][0] == ''
def test_singleline(): path = os.path.join(_basepath, 'single_line_comment.py') src = Source(path) sections = list(src.read_sections()) assert len(sections) == 2 assert sections[1][0] == ' This is a single line comment\n'