def test_parse_multiple_start_lines_with_end_lines(self): change_note = '# {0}\r\nfoo\r\n\r\n# {0}\r\nbar\r\n\r\nincluded\r\n\r\n# not included'.format( self.title) parser = ChangeNotesLinesParser(None, self.title) parser.parse(change_note) self.assertEqual(parser.content, ['foo', 'bar', 'included'])
def test_parse_start_line_end_at_header(self): change_note = '# {}\r\nfoo\r\n# Another Header\r\nbar'.format( self.title) parser = ChangeNotesLinesParser(None, self.title) parser.parse(change_note) self.assertEqual(parser.content, ['foo'])
def test_parse_start_line_no_content_no_end_line(self): change_note = '# {}'.format(self.title) parser = ChangeNotesLinesParser(None, self.title) parser.parse(change_note) self.assertEqual(parser.content, [])
def test_parse_multi_level_indent(self): change_note = '# {0}\r\nfoo \r\n bar \r\n baz \r\n'.format( self.title) parser = ChangeNotesLinesParser(None, self.title) parser.parse(change_note) self.assertEqual(parser.content, ['foo', ' bar', ' baz'])
def test_parse_no_start_line(self): change_note = 'foo\r\nbar\r\n' parser = ChangeNotesLinesParser(None, self.title) parser.parse(change_note) self.assertEqual(parser.content, [])