Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(127)

Side by Side Diff: frontend/afe/frontend_test_utils.py

Issue 6539001: Merge remote branch 'cros/upstream' into master. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/autotest.git@master
Patch Set: patch Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « database/schema_051.sql ('k') | frontend/afe/resources_test.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 import atexit, datetime, os, tempfile, unittest 1 import atexit, datetime, os, tempfile, unittest
2 import common 2 import common
3 from autotest_lib.frontend import setup_test_environment 3 from autotest_lib.frontend import setup_test_environment
4 from autotest_lib.frontend import thread_local 4 from autotest_lib.frontend import thread_local
5 from autotest_lib.frontend.afe import models, model_attributes 5 from autotest_lib.frontend.afe import models, model_attributes
6 from autotest_lib.client.common_lib import global_config 6 from autotest_lib.client.common_lib import global_config
7 from autotest_lib.client.common_lib.test_utils import mock 7 from autotest_lib.client.common_lib.test_utils import mock
8 8
9 class FrontendTestMixin(object): 9 class FrontendTestMixin(object):
10 def _fill_in_test_data(self): 10 def _fill_in_test_data(self):
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 self.hosts[hostnum].labels.add(self.label5) # an atomic group lavel 61 self.hosts[hostnum].labels.add(self.label5) # an atomic group lavel
62 self.hosts[hostnum].labels.add(self.label6) # a normal label 62 self.hosts[hostnum].labels.add(self.label6) # a normal label
63 self.hosts[hostnum].labels.add(self.label7) 63 self.hosts[hostnum].labels.add(self.label7)
64 64
65 65
66 def _frontend_common_setup(self, fill_data=True): 66 def _frontend_common_setup(self, fill_data=True):
67 self.god = mock.mock_god(ut=self) 67 self.god = mock.mock_god(ut=self)
68 setup_test_environment.set_up() 68 setup_test_environment.set_up()
69 global_config.global_config.override_config_value( 69 global_config.global_config.override_config_value(
70 'AUTOTEST_WEB', 'parameterized_jobs', 'False') 70 'AUTOTEST_WEB', 'parameterized_jobs', 'False')
71 global_config.global_config.override_config_value(
72 'SERVER', 'rpc_logging', 'False')
73
71 if fill_data: 74 if fill_data:
72 self._fill_in_test_data() 75 self._fill_in_test_data()
73 76
74 77
75 def _frontend_common_teardown(self): 78 def _frontend_common_teardown(self):
76 setup_test_environment.tear_down() 79 setup_test_environment.tear_down()
77 thread_local.set_user(None) 80 thread_local.set_user(None)
78 self.god.unstub_all() 81 self.god.unstub_all()
79 82
80 83
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 def _create_job_simple(self, hosts, use_metahost=False, 146 def _create_job_simple(self, hosts, use_metahost=False,
144 priority=0, active=False, drone_set=None): 147 priority=0, active=False, drone_set=None):
145 """An alternative interface to _create_job""" 148 """An alternative interface to _create_job"""
146 args = {'hosts' : [], 'metahosts' : []} 149 args = {'hosts' : [], 'metahosts' : []}
147 if use_metahost: 150 if use_metahost:
148 args['metahosts'] = hosts 151 args['metahosts'] = hosts
149 else: 152 else:
150 args['hosts'] = hosts 153 args['hosts'] = hosts
151 return self._create_job(priority=priority, active=active, 154 return self._create_job(priority=priority, active=active,
152 drone_set=drone_set, **args) 155 drone_set=drone_set, **args)
OLDNEW
« no previous file with comments | « database/schema_051.sql ('k') | frontend/afe/resources_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698