Skip to content

Commit

Permalink
[#39]: Add tests folder
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobDomagala committed Oct 26, 2022
1 parent 5225cc7 commit 6e61ae8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Binary file not shown.
20 changes: 20 additions & 0 deletions test/test_static_analysis.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import unittest

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)

if __name__ == '__main__':
unittest.main()

0 comments on commit 6e61ae8

Please sign in to comment.