-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
34 lines (29 loc) · 1 KB
/
test.py
File metadata and controls
34 lines (29 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import unittest
import textractutil
class parametrizedTestCase(unittest.TestCase):
def __init__(self, methodName="runTest", **kwargs):
"""
Any parameterized tests should inherit this class
"""
super(parametrizedTestCase, self).__init__(methodName)
self.kwargs = kwargs
@staticmethod
def parametrize(testcase_class, **kwargs):
"""
Create a suite containing all tests taken from the given subclass, passing them the parameter "param".
"""
test_names = unittest.TestLoader().getTestCaseNames(testcase_class)
suite = unittest.TestSuite()
for name in test_names:
suite.addTest(testcase_class(methodName=name, **kwargs))
return suite
class textractutil_test(parametrizedTestCase):
def test_get_text(self):
# Bypass test for now, will add later.
self.assertEqual(1,1)
test_cases = [{}]
if __name__ == "__main__":
for test_case in test_cases:
suite = unittest.TestSuite()
suite.addTest(parametrizedTestCase.parametrize(textractutil_test, **test_case))
unittest.TextTestRunner().run(suite)