forked from autotest/autotest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfrontend_unittest.py
executable file
·35 lines (26 loc) · 1.04 KB
/
frontend_unittest.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
#!/usr/bin/python
import unittest, os
try:
import autotest.common as common
except ImportError:
import common
from autotest.frontend import setup_django_environment
from autotest.frontend import setup_test_environment
from autotest.frontend.afe import test, readonly_connection
from autotest.client.shared import global_config
_APP_DIR = os.path.join(os.path.dirname(__file__), 'afe')
class FrontendTest(unittest.TestCase):
def setUp(self):
setup_test_environment.set_up()
global_config.global_config.override_config_value(
'AUTOTEST_WEB', 'parameterized_jobs', 'False')
global_config.global_config.override_config_value(
'SERVER', 'rpc_logging', 'False')
def tearDown(self):
setup_test_environment.tear_down()
def test_all(self):
doctest_runner = test.DoctestRunner(_APP_DIR, 'frontend.afe')
errors = doctest_runner.run_tests()
self.assert_(errors == 0, '%s failures in frontend unit tests' % errors)
if __name__ == '__main__':
unittest.main()