OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 | 2 |
3 import common | 3 import common |
4 import unittest | 4 import unittest |
| 5 |
| 6 # This has to be done very early. |
| 7 from autotest_lib.client.common_lib import global_config |
| 8 global_config.global_config.override_config_value( |
| 9 'HOSTS', 'default_protection', |
| 10 'NO_PROTECTION') |
| 11 from autotest_lib.client.common_lib import host_protections |
| 12 |
5 from autotest_lib.frontend import setup_django_environment | 13 from autotest_lib.frontend import setup_django_environment |
6 from autotest_lib.frontend import setup_test_environment | 14 from autotest_lib.frontend import setup_test_environment |
7 from django.test import client | 15 from django.test import client |
8 from autotest_lib.frontend.shared import resource_test_utils | 16 from autotest_lib.frontend.shared import resource_test_utils |
9 from autotest_lib.frontend.afe import control_file, models, model_attributes | 17 from autotest_lib.frontend.afe import control_file, models, model_attributes |
10 | 18 |
11 class AfeResourceTestCase(resource_test_utils.ResourceTestCase): | 19 class AfeResourceTestCase(resource_test_utils.ResourceTestCase): |
12 URI_PREFIX = 'http://testserver/afe/server/resources' | 20 URI_PREFIX = 'http://testserver/afe/server/resources' |
13 | 21 |
14 CONTROL_FILE_CONTENTS = 'my control file contents' | 22 CONTROL_FILE_CONTENTS = 'my control file contents' |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 def test_get(self): | 390 def test_get(self): |
383 response = self.request('get', '') | 391 response = self.request('get', '') |
384 for key in ('atomic_group_classes', 'labels', 'users', 'acl_groups', | 392 for key in ('atomic_group_classes', 'labels', 'users', 'acl_groups', |
385 'hosts', 'tests', 'jobs', 'execution_info', | 393 'hosts', 'tests', 'jobs', 'execution_info', |
386 'queue_entries_request'): | 394 'queue_entries_request'): |
387 self.assert_(key in response) | 395 self.assert_(key in response) |
388 | 396 |
389 | 397 |
390 if __name__ == '__main__': | 398 if __name__ == '__main__': |
391 unittest.main() | 399 unittest.main() |
OLD | NEW |