def test_count_several_lines(self): """Test with several lines of text.""" self.assertEqual(count_lines_with_wrapping("1\n2\n3\n"), 3)
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)
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)
def check(self, expected, text, linewidth): return self.assertEqual( expected, count_lines_with_wrapping(text, linewidth), )
def test_count_empty(self): """Test with an empty string.""" self.assertEqual(count_lines_with_wrapping(""), 0)
def check(self, expected, text, linewidth, tabwidth): return self.assertEqual( expected, count_lines_with_wrapping(text, linewidth, tabwidth), )