[Python-checkins] r75072 - python/branches/py3k/Lib/test/test_string.py

ezio.melotti python-checkins at python.org
Sat Sep 26 14:19:30 CEST 2009


Author: ezio.melotti
Date: Sat Sep 26 14:19:30 2009
New Revision: 75072
Log:
string.capwords is still around, adding back the tests
Modified:
 python/branches/py3k/Lib/test/test_string.py
Modified: python/branches/py3k/Lib/test/test_string.py
==============================================================================
--- python/branches/py3k/Lib/test/test_string.py	(original)
+++ python/branches/py3k/Lib/test/test_string.py	Sat Sep 26 14:19:30 2009
@@ -15,6 +15,14 @@
 string.punctuation
 string.printable
 
+ def test_capwords(self):
+ self.assertEqual(string.capwords('abc def ghi'), 'Abc Def Ghi')
+ self.assertEqual(string.capwords('abc\tdef\nghi'), 'Abc Def Ghi')
+ self.assertEqual(string.capwords('abc\t def \nghi'), 'Abc Def Ghi')
+ self.assertEqual(string.capwords('ABC DEF GHI'), 'Abc Def Ghi')
+ self.assertEqual(string.capwords('ABC-DEF-GHI', '-'), 'Abc-Def-Ghi')
+ self.assertEqual(string.capwords('ABC-def DEF-ghi GHI'), 'Abc-def Def-ghi Ghi')
+
 def test_formatter(self):
 fmt = string.Formatter()
 self.assertEqual(fmt.format("foo"), "foo")


More information about the Python-checkins mailing list

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