mbligh | fa29a2a | 2008-05-16 22:48:09 +0000 | [diff] [blame] | 1 | #!/usr/bin/python |
showard | f699a2c | 2008-04-09 23:29:06 +0000 | [diff] [blame] | 2 | |
showard | 2e490cc | 2008-10-08 19:15:45 +0000 | [diff] [blame] | 3 | import unittest, os |
showard | 56e9377 | 2008-10-06 10:06:22 +0000 | [diff] [blame] | 4 | import common |
showard | 364fe86 | 2008-10-17 02:01:16 +0000 | [diff] [blame] | 5 | from autotest_lib.frontend import setup_django_environment |
| 6 | from autotest_lib.frontend import setup_test_environment |
Jakob Juelich | c5fcff6 | 2014-10-14 19:21:09 -0700 | [diff] [blame] | 7 | from autotest_lib.frontend.afe import test |
jamesren | 7f0e2c7 | 2010-07-29 17:37:16 +0000 | [diff] [blame] | 8 | from autotest_lib.client.common_lib import global_config |
showard | f699a2c | 2008-04-09 23:29:06 +0000 | [diff] [blame] | 9 | |
showard | 2e490cc | 2008-10-08 19:15:45 +0000 | [diff] [blame] | 10 | _APP_DIR = os.path.join(os.path.dirname(__file__), 'afe') |
| 11 | |
showard | f699a2c | 2008-04-09 23:29:06 +0000 | [diff] [blame] | 12 | class FrontendTest(unittest.TestCase): |
showard | 56e9377 | 2008-10-06 10:06:22 +0000 | [diff] [blame] | 13 | def setUp(self): |
showard | f8b1904 | 2009-05-12 17:22:49 +0000 | [diff] [blame] | 14 | setup_test_environment.set_up() |
jamesren | 7f0e2c7 | 2010-07-29 17:37:16 +0000 | [diff] [blame] | 15 | global_config.global_config.override_config_value( |
| 16 | 'AUTOTEST_WEB', 'parameterized_jobs', 'False') |
Eric Li | 8a12e80 | 2011-02-17 14:24:13 -0800 | [diff] [blame] | 17 | global_config.global_config.override_config_value( |
| 18 | 'SERVER', 'rpc_logging', 'False') |
showard | 56e9377 | 2008-10-06 10:06:22 +0000 | [diff] [blame] | 19 | |
| 20 | |
| 21 | def tearDown(self): |
showard | f8b1904 | 2009-05-12 17:22:49 +0000 | [diff] [blame] | 22 | setup_test_environment.tear_down() |
showard | 56e9377 | 2008-10-06 10:06:22 +0000 | [diff] [blame] | 23 | |
| 24 | |
jadmanski | 0afbb63 | 2008-06-06 21:10:57 +0000 | [diff] [blame] | 25 | def test_all(self): |
showard | 2e490cc | 2008-10-08 19:15:45 +0000 | [diff] [blame] | 26 | doctest_runner = test.DoctestRunner(_APP_DIR, 'frontend.afe') |
| 27 | errors = doctest_runner.run_tests() |
showard | 2de8f90 | 2008-06-13 20:49:25 +0000 | [diff] [blame] | 28 | self.assert_(errors == 0, '%s failures in frontend unit tests' % errors) |
showard | f699a2c | 2008-04-09 23:29:06 +0000 | [diff] [blame] | 29 | |
showard | 2e490cc | 2008-10-08 19:15:45 +0000 | [diff] [blame] | 30 | |
showard | f699a2c | 2008-04-09 23:29:06 +0000 | [diff] [blame] | 31 | if __name__ == '__main__': |
jadmanski | 0afbb63 | 2008-06-06 21:10:57 +0000 | [diff] [blame] | 32 | unittest.main() |