(self)
| 1057 | self.assertEqual(indent(text, prefix, predicate), expect) |
| 1058 | |
| 1059 | def test_indent_empty_lines(self): |
| 1060 | # Add 'prefix' solely to whitespace-only lines. |
| 1061 | prefix = ' ' |
| 1062 | expected = ( |
| 1063 | # Basic test case |
| 1064 | "Hi.\nThis is a test.\nTesting.", |
| 1065 | # Include a blank line |
| 1066 | "Hi.\nThis is a test.\n \nTesting.", |
| 1067 | # Include leading and trailing blank lines |
| 1068 | " \nHi.\nThis is a test.\nTesting.\n", |
| 1069 | # Use Windows line endings |
| 1070 | "Hi.\r\nThis is a test.\r\nTesting.\r\n", |
| 1071 | # Pathological case |
| 1072 | " \nHi.\r\nThis is a test.\n \r\nTesting.\r\n \n", |
| 1073 | ) |
| 1074 | predicate = lambda line: not line.strip() |
| 1075 | for text, expect in zip(self.CASES, expected): |
| 1076 | self.assertEqual(indent(text, prefix, predicate), expect) |
| 1077 | |
| 1078 | |
| 1079 | class ShortenTestCase(BaseTestCase): |
nothing calls this directly
no test coverage detected