| 22 | import unittest |
| 23 | |
| 24 | class TestStringMethods(unittest.TestCase): |
| 25 | |
| 26 | def test_upper(self): |
| 27 | self.assertEqual('foo'.upper(), 'FOO') |
| 28 | |
| 29 | def test_isupper(self): |
| 30 | self.assertTrue('FOO'.isupper()) |
| 31 | self.assertFalse('Foo'.isupper()) |
| 32 | |
| 33 | def test_split(self): |
| 34 | s = 'hello world' |
| 35 | self.assertEqual(s.split(), ['hello', 'world']) |
| 36 | # check that s.split fails when the separator is not a string |
| 37 | with self.assertRaises(TypeError): |
| 38 | s.split(2) |
| 39 | |
| 40 | if __name__ == '__main__': |
| 41 | unittest.main() |
nothing calls this directly
no outgoing calls
no test coverage detected