Пример #1
0
 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
 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)
Пример #3
0
 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
 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
 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)
Пример #6
0
 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)
Пример #7
0
 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)
Пример #8
0
 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)
Пример #9
0
 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)
Пример #10
0
 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)
Пример #11
0
 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)
Пример #12
0
 def test_zero_lines(self):
     source = []
     expected = []
     actual = first_paragraph_indent(source)
     self.assertEqual(actual, expected)
Пример #13
0
 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
 def test_zero_lines(self):
     source   = []
     expected = []
     actual = first_paragraph_indent(source)
     self.assertEqual(actual, expected)