1#!/usr/bin/python
2
3import unittest, os
4import common
5from autotest_lib.frontend import setup_django_environment
6from autotest_lib.frontend import setup_test_environment
7from autotest_lib.frontend.afe import test
8from autotest_lib.client.common_lib import global_config
9
10_APP_DIR = os.path.join(os.path.dirname(__file__), 'afe')
11
12class FrontendTest(unittest.TestCase):
13    def setUp(self):
14        setup_test_environment.set_up()
15        global_config.global_config.override_config_value(
16                'AUTOTEST_WEB', 'parameterized_jobs', 'False')
17        global_config.global_config.override_config_value(
18                'SERVER', 'rpc_logging', 'False')
19
20
21    def tearDown(self):
22        setup_test_environment.tear_down()
23
24
25    def test_all(self):
26        doctest_runner = test.DoctestRunner(_APP_DIR, 'frontend.afe')
27        errors = doctest_runner.run_tests()
28        self.assert_(errors == 0, '%s failures in frontend unit tests' % errors)
29
30
31if __name__ == '__main__':
32    unittest.main()
33