mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
string.capwords is still around, adding back the tests
This commit is contained in:
parent
ab170681f6
commit
2c6a949e43
1 changed files with 8 additions and 0 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue