diff options
author | Greg Ward <gward@python.net> | 2002-08-22 19:06:45 (GMT) |
---|---|---|
committer | Greg Ward <gward@python.net> | 2002-08-22 19:06:45 (GMT) |
commit | f69d3c9849dd8aaea11def67ba0f009dc8492d2f (patch) | |
tree | 0c87deee313a9293c12d638521e0681413cd7629 /Lib/test/test_textwrap.py | |
parent | fd030e46a783c12dea259e75435a60e6c6617cb5 (diff) | |
download | cpython-f69d3c9849dd8aaea11def67ba0f009dc8492d2f.zip cpython-f69d3c9849dd8aaea11def67ba0f009dc8492d2f.tar.gz cpython-f69d3c9849dd8aaea11def67ba0f009dc8492d2f.tar.bz2 |
Simplification/cleanup in IndentTestCases.
Diffstat (limited to 'Lib/test/test_textwrap.py')
-rw-r--r-- | Lib/test/test_textwrap.py | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/Lib/test/test_textwrap.py b/Lib/test/test_textwrap.py index bec5ac5..227206c 100644 --- a/Lib/test/test_textwrap.py +++ b/Lib/test/test_textwrap.py @@ -167,7 +167,7 @@ class IndentTestCases(BaseTestCase): # called before each test method def setUp(self): - self.testString = '''\ + self.text = '''\ This paragraph will be filled, first without any indentation, and then with some (including a hanging indent).''' @@ -180,27 +180,21 @@ This paragraph will be filled, first without any indentation, and then with some (including a hanging indent).''' - result = fill(self.testString, 40) + result = fill(self.text, 40) self.check(result, expect) def test_initial_indent(self): '''Test initial_indent parameter.''' - expect = [ - " This paragraph will be filled,", - "first without any indentation, and then", - "with some (including a hanging indent)."] - - result = wrap(self.testString, 40, initial_indent=" ") + expect = [" This paragraph will be filled,", + "first without any indentation, and then", + "with some (including a hanging indent)."] + result = wrap(self.text, 40, initial_indent=" ") self.check(result, expect) - expect = '''\ - This paragraph will be filled, -first without any indentation, and then -with some (including a hanging indent).''' - - result = fill(self.testString, 40, initial_indent=" ") + expect = "\n".join(expect) + result = fill(self.text, 40, initial_indent=" ") self.check(result, expect) @@ -213,8 +207,8 @@ with some (including a hanging indent).''' with some (including a hanging indent).''' - result = fill(self.testString, 40, initial_indent=" * ", - subsequent_indent=" ") + result = fill(self.text, 40, + initial_indent=" * ", subsequent_indent=" ") self.check(result, expect) |