Ejemplo n.º 1
0
    def test_two_empty_lines(self):
        """A list of four entries should return a list of two joined strings.

        This test is basically the same test as above, but added to illustrate the usage
        of this method to join empty lines.
        """
        lines = ["", "\n", "", "\n"]
        expected = ["\n", "\n"]
        actual = helpers.join_lineseps(lines)
        assert expected == actual
Ejemplo n.º 2
0
 def test_form_feed_character(self):
     """Form feed character should be treated like any other character."""
     lines = ["line1", "\n", "line2\fstill on line2"]
     expected = ["line1\n", "line2\fstill on line2"]
     actual = helpers.join_lineseps(lines)
     assert expected == actual
Ejemplo n.º 3
0
 def test_two_lines_with_eof_newline(self):
     """A list of four entries should return a list of two joined strings."""
     lines = ["line1", "\n", "line2", "\n"]
     expected = ["line1\n", "line2\n"]
     actual = helpers.join_lineseps(lines)
     assert expected == actual
Ejemplo n.º 4
0
 def test_two_lines_no_eof_newline(self):
     """A list of three entries should return the first two joined and the last."""
     lines = ["line1", "\n", "line2"]
     expected = ["line1\n", "line2"]
     actual = helpers.join_lineseps(lines)
     assert expected == actual
Ejemplo n.º 5
0
 def test_one_line_with_newline(self):
     """A list of two entries should return one entry with the joined string."""
     lines = ["line1", "\n"]
     expected = ["line1\n"]
     actual = helpers.join_lineseps(lines)
     assert expected == actual
Ejemplo n.º 6
0
 def test_one_line(self):
     """A list with a single entry should return the same entry back."""
     lines = ["line1"]
     expected = ["line1"]
     actual = helpers.join_lineseps(lines)
     assert expected == actual
Ejemplo n.º 7
0
 def test_empty_list(self):
     """Empty list of lines should return empty list."""
     lines = []
     expected = []
     actual = helpers.join_lineseps(lines)
     assert expected == actual