blob: 6aac47da9d994d92d3c054926b3e4f4a7781354c [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
showard56e93772008-10-06 10:06:22 +00007from autotest_lib.frontend.afe import test, readonly_connection
showardf699a2c2008-04-09 23:29:06 +00008
showard2e490cc2008-10-08 19:15:45 +00009_APP_DIR = os.path.join(os.path.dirname(__file__), 'afe')
10
showardf699a2c2008-04-09 23:29:06 +000011class FrontendTest(unittest.TestCase):
showard56e93772008-10-06 10:06:22 +000012 def setUp(self):
13 readonly_connection.ReadOnlyConnection.set_testing_mode(True)
14
15
16 def tearDown(self):
17 readonly_connection.ReadOnlyConnection.set_testing_mode(False)
18
19
jadmanski0afbb632008-06-06 21:10:57 +000020 def test_all(self):
showard2e490cc2008-10-08 19:15:45 +000021 doctest_runner = test.DoctestRunner(_APP_DIR, 'frontend.afe')
22 errors = doctest_runner.run_tests()
showard2de8f902008-06-13 20:49:25 +000023 self.assert_(errors == 0, '%s failures in frontend unit tests' % errors)
showardf699a2c2008-04-09 23:29:06 +000024
showard2e490cc2008-10-08 19:15:45 +000025
showardf699a2c2008-04-09 23:29:06 +000026if __name__ == '__main__':
jadmanski0afbb632008-06-06 21:10:57 +000027 unittest.main()