diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2009-09-26 12:19:30 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2009-09-26 12:19:30 (GMT) |
commit | 2c6a949e43f55ddd0a09e1eba611f03a47268913 (patch) | |
tree | 42d9cac21fbe28ed46098b2e01a19d07e300894e /Lib/test/test_string.py | |
parent | ab170681f6ad92766fa654ea80d6d011456c7d2f (diff) | |
download | cpython-2c6a949e43f55ddd0a09e1eba611f03a47268913.zip cpython-2c6a949e43f55ddd0a09e1eba611f03a47268913.tar.gz cpython-2c6a949e43f55ddd0a09e1eba611f03a47268913.tar.bz2 |
string.capwords is still around, adding back the tests
Diffstat (limited to 'Lib/test/test_string.py')
-rw-r--r-- | Lib/test/test_string.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_string.py b/Lib/test/test_string.py index 16d1edb..743fa6b 100644 --- a/Lib/test/test_string.py +++ b/Lib/test/test_string.py @@ -15,6 +15,14 @@ class ModuleTest(unittest.TestCase): 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") |