-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsample.py
executable file
·65 lines (54 loc) · 1.45 KB
/
sample.py
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/usr/bin/env python
import unittest
from index import IndexFrontend
from hypercategory import HyperCategory
class ClientBase(unittest.TestCase):
report = None
index = IndexFrontend
@classmethod
def setUpClass(cls):
cls.index = IndexFrontend
ClientBase.report = 'report'
cls.prepare()
pass
@classmethod
def prepare(cls):
"""
need to be overriden
"""
class ClientTests(ClientBase):
def test_one(self):
self.index.categories = [
HyperCategory(123, children=[
HyperCategory(222, children=[
HyperCategory(333),
HyperCategory(444)
]),
HyperCategory(345)
]
)]
print('test one')
print(self.report)
#self.report
#self.showlog
#self.qupdate
def test_two(self):
print('test two')
print(self.report)
def clientmain():
runner = unittest.TextTestRunner()
test = ClientTests()
runner.run(test)
#loader = unittest.TestLoader()
#tests = loader.loadTestsFromModule(sys.modules[__name__])
if __name__ == '__main__':
#clientmain()
unittest.main()
'''
runner = unittest.TextTestRunner()
loader = unittest.TestLoader()
tests = loader.loadTestsFromModule(sys.modules[__name__])
with MyTestSuite() as suite:
suite.addTests(tests)
runner.run(suite)
'''