From: Greg Ward Date: Thu, 22 Aug 2002 19:06:45 +0000 (+0000) Subject: Simplification/cleanup in IndentTestCases. X-Git-Tag: v2.3c1~4353 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f69d3c9849dd8aaea11def67ba0f009dc8492d2f;p=python Simplification/cleanup in IndentTestCases. --- diff --git a/Lib/test/test_textwrap.py b/Lib/test/test_textwrap.py index bec5ac5902..227206cd3f 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)