Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2c6a949

Browse files
committed
string.capwords is still around, adding back the tests
1 parent ab17068 commit 2c6a949

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

Lib/test/test_string.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ def test_attrs(self):
1515
string.punctuation
1616
string.printable
1717

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+
1826
def test_formatter(self):
1927
fmt = string.Formatter()
2028
self.assertEqual(fmt.format("foo"), "foo")

0 commit comments

Comments
 (0)