コード例 #1
0
ファイル: test_parser.py プロジェクト: jhermann/cartouche
 def test_separate_paragraphs(self):
     source = [(0, "This is the first paragraph"), (0, ""),
               (4, "This is the second paragraph")]
     expected = [(0, "This is the first paragraph"), (0, ""),
                 (4, "This is the second paragraph")]
     actual = first_paragraph_indent(source)
     self.assertEqual(actual, expected)
コード例 #2
0
ファイル: test_parser.py プロジェクト: jhermann/cartouche
 def test_double_line_indented_comment(self):
     source   = [(4, "The first line"),
                 (4, "The second line")]
     expected = [(4, "The first line"),
                 (4, "The second line")]
     actual = first_paragraph_indent(source)
     self.assertEqual(actual, expected)
コード例 #3
0
ファイル: test_parser.py プロジェクト: jhermann/cartouche
 def test_increasing_indent(self):
     source = [(0, "The first line"), (4, "The second line"),
               (8, "The third line")]
     expected = [(4, "The first line"), (4, "The second line"),
                 (8, "The third line")]
     actual = first_paragraph_indent(source)
     self.assertEqual(actual, expected)
コード例 #4
0
ファイル: test_parser.py プロジェクト: jhermann/cartouche
 def test_first_line_non_indent(self):
     source   = [(0, "The first line"),
                 (4, "The second line")]
     expected = [(4, "The first line"),
                 (4, "The second line")]
     actual = first_paragraph_indent(source)
     self.assertEqual(actual, expected)
コード例 #5
0
ファイル: test_parser.py プロジェクト: jhermann/cartouche
 def test_separated_lines_first_line_indented(self):
     source   = [(4, "The first line"),
                 (4, ""),
                 (4, "The third line")]
     expected = [(4, "The first line"),
                 (4, ""),
                 (4, "The third line")]
     actual = first_paragraph_indent(source)
     self.assertEqual(actual, expected)
コード例 #6
0
ファイル: test_parser.py プロジェクト: jhermann/cartouche
 def test_separate_paragraphs_indented(self):
     source   = [(4, "This is the first paragraph"),
                 (4, ""),
                 (8, "This is the second paragraph")]
     expected = [(4, "This is the first paragraph"),
                 (4, ""),
                 (8, "This is the second paragraph")]
     actual = first_paragraph_indent(source)
     self.assertEqual(actual, expected)
コード例 #7
0
ファイル: test_parser.py プロジェクト: jhermann/cartouche
 def test_increasing_indent(self):
     source   = [(0, "The first line"),
                 (4, "The second line"),
                 (8, "The third line")]
     expected = [(4, "The first line"),
                 (4, "The second line"),
                 (8, "The third line")]
     actual = first_paragraph_indent(source)
     self.assertEqual(actual, expected)
コード例 #8
0
ファイル: test_parser.py プロジェクト: jhermann/cartouche
 def test_first_line_non_indent(self):
     source = [(0, "The first line"), (4, "The second line")]
     expected = [(4, "The first line"), (4, "The second line")]
     actual = first_paragraph_indent(source)
     self.assertEqual(actual, expected)
コード例 #9
0
ファイル: test_parser.py プロジェクト: jhermann/cartouche
 def test_double_line_indented_comment(self):
     source = [(4, "The first line"), (4, "The second line")]
     expected = [(4, "The first line"), (4, "The second line")]
     actual = first_paragraph_indent(source)
     self.assertEqual(actual, expected)
コード例 #10
0
ファイル: test_parser.py プロジェクト: jhermann/cartouche
 def test_single_line_indented_comment(self):
     source = [(4, "A single line comment")]
     expected = [(4, "A single line comment")]
     actual = first_paragraph_indent(source)
     self.assertEqual(actual, expected)
コード例 #11
0
ファイル: test_parser.py プロジェクト: jhermann/cartouche
 def test_zero_lines(self):
     source = []
     expected = []
     actual = first_paragraph_indent(source)
     self.assertEqual(actual, expected)
コード例 #12
0
ファイル: test_parser.py プロジェクト: jhermann/cartouche
 def test_separated_lines_first_line_indented(self):
     source = [(4, "The first line"), (4, ""), (4, "The third line")]
     expected = [(4, "The first line"), (4, ""), (4, "The third line")]
     actual = first_paragraph_indent(source)
     self.assertEqual(actual, expected)
コード例 #13
0
ファイル: test_parser.py プロジェクト: jhermann/cartouche
 def test_single_line_indented_comment(self):
     source   = [(4, "A single line comment")]
     expected = [(4, "A single line comment")]
     actual = first_paragraph_indent(source)
     self.assertEqual(actual, expected)
コード例 #14
0
ファイル: test_parser.py プロジェクト: jhermann/cartouche
 def test_zero_lines(self):
     source   = []
     expected = []
     actual = first_paragraph_indent(source)
     self.assertEqual(actual, expected)