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)
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)
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)
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)
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)
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)
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)
def test_zero_lines(self): source = [] expected = [] actual = first_paragraph_indent(source) self.assertEqual(actual, expected)