[Python-checkins] python/dist/src/Lib/test test_textwrap.py,1.19,1.20

gward@users.sourceforge.net gward@users.sourceforge.net
2003年5月06日 17:54:45 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1:/tmp/cvs-serv18955
Modified Files:
	test_textwrap.py 
Log Message:
SF #726446: ensure wrap() raises ValueError when width <= 0.
Index: test_textwrap.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_textwrap.py,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** test_textwrap.py	1 May 2003 17:45:51 -0000	1.19
--- test_textwrap.py	7 May 2003 00:54:42 -0000	1.20
***************
*** 263,266 ****
--- 263,272 ----
 "ball,", " ", "use", " ", "the", " ", "-b", " ", "option!"])
 
+ def test_bad_width(self):
+ # Ensure that width <= 0 is caught.
+ text = "Whatever, it doesn't matter."
+ self.assertRaises(ValueError, wrap, text, 0)
+ self.assertRaises(ValueError, wrap, text, -1)
+ 
 
 class LongWordTestCase (BaseTestCase):

AltStyle によって変換されたページ (->オリジナル) /