Simple test, sample data generation script and more

Signed-off-by: Václav Valíček <valicek1994@gmail.com>
This commit is contained in:
2022-05-04 10:52:07 +02:00
parent 0d1ea25dd1
commit 97f11ab719
6 changed files with 46 additions and 4 deletions

View File

@@ -0,0 +1,2 @@
#!/bin/bash
echo TODO: add some support data

24
tests/test_abcd.py Normal file
View File

@@ -0,0 +1,24 @@
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()