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