-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
37 lines (29 loc) · 1.1 KB
/
test.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
import unittest
from config.app import DEBUGConfig
from tests.utils.generate_agent_test import TestGenerateAgent
from tests.handlers.file_test import TestGenerateFileName, TestWriteToFile
from tests.utils.check_url_test import TestCheckDuplicateURL, TestIsURLValid
from tests.handlers.get_url_test import TestGenerateQuery, TestBypassSafeSearch
def main():
# Disable debug and verbose mode
DEBUGConfig['debug'] = False
DEBUGConfig['verbose'] = False
loader = unittest.TestLoader()
test_case = [
# Load Check URL Test
loader.loadTestsFromTestCase(TestIsURLValid),
loader.loadTestsFromTestCase(TestCheckDuplicateURL),
# Load Agent Test
loader.loadTestsFromTestCase(TestGenerateAgent),
# Load File Test
loader.loadTestsFromTestCase(TestWriteToFile),
loader.loadTestsFromTestCase(TestGenerateFileName),
# Load Get URL Test
loader.loadTestsFromTestCase(TestGenerateQuery),
loader.loadTestsFromTestCase(TestBypassSafeSearch),
]
suite = unittest.TestSuite(test_case)
runner = unittest.TextTestRunner(verbosity=2)
runner.run(suite)
if __name__ == '__main__':
main()