In [1]:
from Module_unittest import del_parenthesis, del_quote
In [2]:
del_parenthesis('hello (world)')
Out[2]:
In [9]:
del_quote('maybe "not"')
Out[9]:
In [4]:
import unittest
In [12]:
class MyTest(unittest.TestCase):
def test1(self):
self.assertEqual(del_parenthesis('hello (world)'), 'hello world')
def test2(self):
self.assertTrue('(' not in del_parenthesis('hello (world)'))
self.assertTrue(')' not in del_parenthesis('hello (world)'))
def test3(self):
self.assertEqual(del_quote('maybe "not"'), 'maybe not')
def test4(self):
self.assertTrue('"' not in del_quote('maybe "not"'))
self.assertTrue("'" not in del_quote('maybe "not"'))
In [13]:
suite = unittest.TestLoader().loadTestsFromTestCase(MyTest)
In [14]:
unittest.TextTestRunner(verbosity=2).run(suite)
Out[14]:
In [ ]: