MCPcopy Index your code
hub / github.com/python/cpython / test_indent_default

Method test_indent_default

Lib/test/test_textwrap.py:1004–1020  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

indentFunction · 0.90
assertEqualMethod · 0.45

Tested by

no test coverage detected