diff options
Diffstat (limited to 'Doc/library/unittest.rst')
-rw-r--r-- | Doc/library/unittest.rst | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst index cacbb3c..64a1834 100644 --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -115,19 +115,19 @@ Here is a short script to test three string methods:: class TestStringMethods(unittest.TestCase): - def test_upper(self): - self.assertEqual('foo'.upper(), 'FOO') - - def test_isupper(self): - self.assertTrue('FOO'.isupper()) - self.assertFalse('Foo'.isupper()) - - def test_split(self): - s = 'hello world' - self.assertEqual(s.split(), ['hello', 'world']) - # check that s.split fails when the separator is not a string - with self.assertRaises(TypeError): - s.split(2) + def test_upper(self): + self.assertEqual('foo'.upper(), 'FOO') + + def test_isupper(self): + self.assertTrue('FOO'.isupper()) + self.assertFalse('Foo'.isupper()) + + def test_split(self): + s = 'hello world' + self.assertEqual(s.split(), ['hello', 'world']) + # check that s.split fails when the separator is not a string + with self.assertRaises(TypeError): + s.split(2) if __name__ == '__main__': unittest.main() |