Skip to content

Commit 1845247

Browse files
committed
add: initial test files
1 parent 60dccf6 commit 1845247

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

tests/test.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Whitespace-only changes.

0 commit comments

Comments
 (0)