示例#1
0
 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'])
示例#2
0
 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'])
示例#3
0
 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, [])
示例#4
0
 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'])
示例#5
0
 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, [])
示例#6
0
 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'])
示例#7
0
 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, [])
示例#8
0
 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'])
示例#9
0
 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, [])
示例#10
0
 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'])