[Python-checkins] python/dist/src/Lib/test test_textwrap.py,1.9,1.10
gvanrossum@users.sourceforge.net
gvanrossum@users.sourceforge.net
Thu, 22 Aug 2002 13:13:51 -0700
Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv32260
Modified Files:
test_textwrap.py
Log Message:
Standardize behavior: no docstrings in test functions. Also strip
trailing whitespace.
Index: test_textwrap.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_textwrap.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** test_textwrap.py 22 Aug 2002 19:47:27 -0000 1.9
--- test_textwrap.py 22 Aug 2002 20:13:47 -0000 1.10
***************
*** 30,34 ****
def check(self, result, expect):
! self.assertEquals(result, expect,
'expected:\n%s\nbut got:\n%s' % (
self.show(expect), self.show(result)))
--- 30,34 ----
def check(self, result, expect):
! self.assertEquals(result, expect,
'expected:\n%s\nbut got:\n%s' % (
self.show(expect), self.show(result)))
***************
*** 45,49 ****
def test_simple(self):
! '''Simple case: just words, spaces, and a bit of punctuation.'''
text = "Hello there, how are you this fine day? I'm glad to hear it!"
--- 45,49 ----
def test_simple(self):
! # Simple case: just words, spaces, and a bit of punctuation
text = "Hello there, how are you this fine day? I'm glad to hear it!"
***************
*** 63,67 ****
def test_whitespace(self):
! '''Whitespace munging and end-of-sentence detection.'''
text = """\
--- 63,67 ----
def test_whitespace(self):
! # Whitespace munging and end-of-sentence detection
text = """\
***************
*** 87,91 ****
def test_wrap_short(self):
! '''Wrapping to make short lines longer.'''
text = "This is a\nshort paragraph."
--- 87,91 ----
def test_wrap_short(self):
! # Wrapping to make short lines longer
text = "This is a\nshort paragraph."
***************
*** 97,101 ****
def test_hyphenated(self):
! '''Test breaking hyphenated words.'''
text = ("this-is-a-useful-feature-for-"
--- 97,101 ----
def test_hyphenated(self):
! # Test breaking hyphenated words
text = ("this-is-a-useful-feature-for-"
***************
*** 113,117 ****
def test_em_dash(self):
! '''Test text with em-dashes.'''
text = "Em-dashes should be written -- thus."
self.check_wrap(text, 25,
--- 113,117 ----
def test_em_dash(self):
! # Test text with em-dashes
text = "Em-dashes should be written -- thus."
self.check_wrap(text, 25,
***************
*** 130,134 ****
self.check_wrap(text, 36,
["Em-dashes should be written -- thus."])
!
# The improperly written em-dash is handled too, because
# it's adjacent to non-whitespace on both sides.
--- 130,134 ----
self.check_wrap(text, 36,
["Em-dashes should be written -- thus."])
!
# The improperly written em-dash is handled too, because
# it's adjacent to non-whitespace on both sides.
***************
*** 165,170 ****
def test_split(self):
! '''Ensure that the standard _split() method works as advertised
! in the comments.'''
text = "Hello there -- you goof-ball, use the -b option!"
--- 165,170 ----
def test_split(self):
! # Ensure that the standard _split() method works as advertised
! # in the comments
text = "Hello there -- you goof-ball, use the -b option!"
***************
*** 185,189 ****
def test_break_long(self):
! '''Wrap text with long words and lots of punctuation.'''
self.check_wrap(self.text, 30,
--- 185,189 ----
def test_break_long(self):
! # Wrap text with long words and lots of punctuation
self.check_wrap(self.text, 30,
***************
*** 197,202 ****
! def test_nobreak_long(self):
! '''Test with break_long_words disabled.'''
self.wrapper.break_long_words = 0
self.wrapper.width = 30
--- 197,202 ----
! def test_nobreak_long(self):
! # Test with break_long_words disabled
self.wrapper.break_long_words = 0
self.wrapper.width = 30
***************
*** 205,209 ****
'How *do* you spell that odd',
'word, anyways?'
! ]
result = self.wrapper.wrap(self.text)
self.check(result, expect)
--- 205,209 ----
'How *do* you spell that odd',
'word, anyways?'
! ]
result = self.wrapper.wrap(self.text)
self.check(result, expect)
***************
*** 225,229 ****
def test_fill(self):
! '''Test the fill() method.'''
expect = '''\
--- 225,229 ----
def test_fill(self):
! # Test the fill() method
expect = '''\
***************
*** 237,241 ****
def test_initial_indent(self):
! '''Test initial_indent parameter.'''
expect = [" This paragraph will be filled,",
--- 237,241 ----
def test_initial_indent(self):
! # Test initial_indent parameter
expect = [" This paragraph will be filled,",
***************
*** 251,255 ****
def test_subsequent_indent(self):
! '''Test subsequent_indent parameter.'''
expect = '''\
--- 251,255 ----
def test_subsequent_indent(self):
! # Test subsequent_indent parameter
expect = '''\