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 60dccf6 commit 1845247Copy full SHA for 1845247
tests/test.py
@@ -0,0 +1,22 @@
1
+#!/usr/bin/env python3
2
+
3
+import unittest
4
5
+class TestStringMethods(unittest.TestCase):
6
7
+ def test_upper(self):
8
+ self.assertEqual('foo'.upper(), 'FOO')
9
10
+ def test_isupper(self):
11
+ self.assertTrue('FOO'.isupper())
12
+ self.assertFalse('Foo'.isupper())
13
14
+ def test_split(self):
15
+ s = 'hello world'
16
+ self.assertEqual(s.split(), ['hello', 'world'])
17
+ # check that s.split fails when the separator is not a string
18
+ with self.assertRaises(TypeError):
19
+ s.split(2)
20
21
+if __name__ == '__main__':
22
+ unittest.main()
tests/unittest_compat.py
0 commit comments