repo-cloner/tests/test_abcd.py
Václav Valíček 97f11ab719 Simple test, sample data generation script and more
Signed-off-by: Václav Valíček <valicek1994@gmail.com>
2022-05-04 10:55:31 +02:00

25 lines
481 B
Python

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()