From 2c6a949e43f55ddd0a09e1eba611f03a47268913 Mon Sep 17 00:00:00 2001 From: Ezio Melotti Date: Sat, 26 Sep 2009 12:19:30 +0000 Subject: [PATCH] string.capwords is still around, adding back the tests --- Lib/test/test_string.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Lib/test/test_string.py b/Lib/test/test_string.py index 16d1edb0e38..743fa6b27fe 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")