-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbugtracker_test.py
37 lines (29 loc) · 1.34 KB
/
bugtracker_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
#pylint: disable=missing-docstring, invalid-name, R0904, W0403, F0401
"""Provides a function that runs all known tests."""
import unittest
from bugtracker import main
from bugtracker import get_arg_parser
from annotations.annotator_test import TestAnnotator
from annotations.bug_test import TestBug
from imageprocessing.analyzer_test import TestAnalyzer
from helper.iohelper_test import TestIOHelper
from testing.testfiles import TestFiles
class TestBugTracker(unittest.TestCase):
def test_exits_normally_on_dry_run(self):
with self.assertRaises(SystemExit):
main(get_arg_parser().parse_args(
["--dry_run",
"-f" + TestFiles.IMG,
"-t" + TestFiles.TEMPLATE,
"-c" + TestFiles.CACHE_DIR,
"-o" + TestFiles.OUT_DIR]))
def execute_all_tests():
"""Runs all known tests."""
unittest.TextTestRunner(verbosity=2).run(unittest.TestSuite([
unittest.TestLoader().loadTestsFromTestCase(TestBugTracker),
unittest.TestLoader().loadTestsFromTestCase(TestBug),
unittest.TestLoader().loadTestsFromTestCase(TestAnnotator),
unittest.TestLoader().loadTestsFromTestCase(TestAnalyzer),
unittest.TestLoader().loadTestsFromTestCase(TestIOHelper)]))
if __name__ == '__main__':
execute_all_tests()