Ejemplo n.º 1
0
 def test_count_several_lines(self):
     """Test with several lines of text."""
     self.assertEqual(count_lines_with_wrapping("1\n2\n3\n"), 3)
Ejemplo n.º 2
0
 def test_count_begins_with_empty_line(self):
     """Test with a string which begins with a newline."""
     self.assertEqual(count_lines_with_wrapping("\ntext"), 2)
Ejemplo n.º 3
0
 def test_count_ends_with_empty_line(self):
     """Test with a string which ends with a newline."""
     self.assertEqual(count_lines_with_wrapping("text\n"), 1)
Ejemplo n.º 4
0
 def check(self, expected, text, linewidth):
     return self.assertEqual(
         expected,
         count_lines_with_wrapping(text, linewidth),
     )
Ejemplo n.º 5
0
 def test_count_empty(self):
     """Test with an empty string."""
     self.assertEqual(count_lines_with_wrapping(""), 0)
Ejemplo n.º 6
0
 def test_count_several_lines(self):
     """Test with several lines of text."""
     self.assertEqual(count_lines_with_wrapping("1\n2\n3\n"), 3)
Ejemplo n.º 7
0
 def test_count_ends_with_empty_line(self):
     """Test with a string which ends with a newline."""
     self.assertEqual(count_lines_with_wrapping("text\n"), 1)
Ejemplo n.º 8
0
 def test_count_begins_with_empty_line(self):
     """Test with a string which begins with a newline."""
     self.assertEqual(count_lines_with_wrapping("\ntext"), 2)
Ejemplo n.º 9
0
 def test_count_empty(self):
     """Test with an empty string."""
     self.assertEqual(count_lines_with_wrapping(""), 0)
Ejemplo n.º 10
0
 def check(self, expected, text, linewidth, tabwidth):
     return self.assertEqual(
         expected,
         count_lines_with_wrapping(text, linewidth, tabwidth),
     )