(self)
| 1002 | self.assertEqual(dedent(indent(text, ' \t \t ')), text) |
| 1003 | |
| 1004 | def test_indent_default(self): |
| 1005 | # Test default indenting of lines that are not whitespace only |
| 1006 | prefix = ' ' |
| 1007 | expected = ( |
| 1008 | # Basic test case |
| 1009 | " Hi.\n This is a test.\n Testing.", |
| 1010 | # Include a blank line |
| 1011 | " Hi.\n This is a test.\n\n Testing.", |
| 1012 | # Include leading and trailing blank lines |
| 1013 | "\n Hi.\n This is a test.\n Testing.\n", |
| 1014 | # Use Windows line endings |
| 1015 | " Hi.\r\n This is a test.\r\n Testing.\r\n", |
| 1016 | # Pathological case |
| 1017 | "\n Hi.\r\n This is a test.\n\r\n Testing.\r\n\n", |
| 1018 | ) |
| 1019 | for text, expect in zip(self.CASES, expected): |
| 1020 | self.assertEqual(indent(text, prefix), expect) |
| 1021 | |
| 1022 | def test_indent_explicit_default(self): |
| 1023 | # Test default indenting of lines that are not whitespace only |
nothing calls this directly
no test coverage detected