blob: 4d1d9020c9ecf5e7506ff5cd4603f5e67f066768 [file] [log] [blame]
mblighfa29a2a2008-05-16 22:48:09 +00001#!/usr/bin/python
showardf699a2c2008-04-09 23:29:06 +00002
showard2e490cc2008-10-08 19:15:45 +00003import unittest, os
showard56e93772008-10-06 10:06:22 +00004import common
showard364fe862008-10-17 02:01:16 +00005from autotest_lib.frontend import setup_django_environment
6from autotest_lib.frontend import setup_test_environment
Jakob Juelichc5fcff62014-10-14 19:21:09 -07007from autotest_lib.frontend.afe import test
jamesren7f0e2c72010-07-29 17:37:16 +00008from autotest_lib.client.common_lib import global_config
showardf699a2c2008-04-09 23:29:06 +00009
showard2e490cc2008-10-08 19:15:45 +000010_APP_DIR = os.path.join(os.path.dirname(__file__), 'afe')
11
showardf699a2c2008-04-09 23:29:06 +000012class FrontendTest(unittest.TestCase):
showard56e93772008-10-06 10:06:22 +000013 def setUp(self):
showardf8b19042009-05-12 17:22:49 +000014 setup_test_environment.set_up()
jamesren7f0e2c72010-07-29 17:37:16 +000015 global_config.global_config.override_config_value(
16 'AUTOTEST_WEB', 'parameterized_jobs', 'False')
Eric Li8a12e802011-02-17 14:24:13 -080017 global_config.global_config.override_config_value(
18 'SERVER', 'rpc_logging', 'False')
showard56e93772008-10-06 10:06:22 +000019
20
21 def tearDown(self):
showardf8b19042009-05-12 17:22:49 +000022 setup_test_environment.tear_down()
showard56e93772008-10-06 10:06:22 +000023
24
jadmanski0afbb632008-06-06 21:10:57 +000025 def test_all(self):
showard2e490cc2008-10-08 19:15:45 +000026 doctest_runner = test.DoctestRunner(_APP_DIR, 'frontend.afe')
27 errors = doctest_runner.run_tests()
showard2de8f902008-06-13 20:49:25 +000028 self.assert_(errors == 0, '%s failures in frontend unit tests' % errors)
showardf699a2c2008-04-09 23:29:06 +000029
showard2e490cc2008-10-08 19:15:45 +000030
showardf699a2c2008-04-09 23:29:06 +000031if __name__ == '__main__':
jadmanski0afbb632008-06-06 21:10:57 +000032 unittest.main()