Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ab17068 commit 2c6a949Copy full SHA for 2c6a949
1 file changed
Lib/test/test_string.py
@@ -15,6 +15,14 @@ def test_attrs(self):
15
string.punctuation
16
string.printable
17
18
+ def test_capwords(self):
19
+ self.assertEqual(string.capwords('abc def ghi'), 'Abc Def Ghi')
20
+ self.assertEqual(string.capwords('abc\tdef\nghi'), 'Abc Def Ghi')
21
+ self.assertEqual(string.capwords('abc\t def \nghi'), 'Abc Def Ghi')
22
+ self.assertEqual(string.capwords('ABC DEF GHI'), 'Abc Def Ghi')
23
+ self.assertEqual(string.capwords('ABC-DEF-GHI', '-'), 'Abc-Def-Ghi')
24
+ self.assertEqual(string.capwords('ABC-def DEF-ghi GHI'), 'Abc-def Def-ghi Ghi')
25
+
26
def test_formatter(self):
27
fmt = string.Formatter()
28
self.assertEqual(fmt.format("foo"), "foo")
0 commit comments