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

Side by Side Diff: server/autotest_unittest.py

Issue 6883035: Merge remote branch 'autotest-upstream/master' into autotest-merge (Closed) Base URL: ssh://gitrw.chromium.org:9222/autotest.git@master
Patch Set: patch Created 9 years, 8 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
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 2
3 __author__ = "raphtee@google.com (Travis Miller)" 3 __author__ = "raphtee@google.com (Travis Miller)"
4 4
5 import unittest, os, tempfile, logging 5 import unittest, os, tempfile, logging
6 6
7 import common 7 import common
8 from autotest_lib.server import autotest, utils, hosts, server_job, profilers 8 from autotest_lib.server import autotest, utils, hosts, server_job, profilers
9 from autotest_lib.client.bin import sysinfo 9 from autotest_lib.client.bin import sysinfo
10 from autotest_lib.client.common_lib import utils as client_utils, packages 10 from autotest_lib.client.common_lib import utils as client_utils, packages
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 run_obj.remote_control_file + '.state', 198 run_obj.remote_control_file + '.state',
199 run_obj.manual_control_file, 199 run_obj.manual_control_file,
200 run_obj.manual_control_file + '.state'] 200 run_obj.manual_control_file + '.state']
201 cmd = ';'.join('rm -f ' + control for control in delete_file_list) 201 cmd = ';'.join('rm -f ' + control for control in delete_file_list)
202 self.host.run.expect_call(cmd, ignore_status=True) 202 self.host.run.expect_call(cmd, ignore_status=True)
203 203
204 utils.get.expect_call(control).and_return("temp") 204 utils.get.expect_call(control).and_return("temp")
205 205
206 c = autotest.global_config.global_config 206 c = autotest.global_config.global_config
207 c.get_config_value.expect_call("PACKAGES", 207 c.get_config_value.expect_call("PACKAGES",
208 'fetch_location', type=list).and_return(['repo']) 208 'fetch_location', type=list, default=[]).and_return(['repo'])
209 pkgmgr = packages.PackageManager.expect_new('autotest', 209 pkgmgr = packages.PackageManager.expect_new('autotest',
210 repo_urls=['repo'], 210 repo_urls=['repo'],
211 hostname='hostname') 211 hostname='hostname')
212 212
213 cfile = self.god.create_mock_class(file, "file") 213 cfile = self.god.create_mock_class(file, "file")
214 cfile_orig = "original control file" 214 cfile_orig = "original control file"
215 cfile_new = "args = []\njob.add_repository(['repo'])\n" 215 cfile_new = "args = []\njob.add_repository(['repo'])\n"
216 cfile_new += cfile_orig 216 cfile_new += cfile_orig
217 217
218 autotest.open.expect_call("temp").and_return(cfile) 218 autotest.open.expect_call("temp").and_return(cfile)
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 349
350 350
351 def test_fails_with_exception(self): 351 def test_fails_with_exception(self):
352 self.assertEqual(False, self.mixin.run_test('sleeptest')) 352 self.assertEqual(False, self.mixin.run_test('sleeptest'))
353 self.assert_("job.run_test('sleeptest')\n" in self.control_file) 353 self.assert_("job.run_test('sleeptest')\n" in self.control_file)
354 self.assertEqual(self.mixin, self.host) 354 self.assertEqual(self.mixin, self.host)
355 355
356 356
357 if __name__ == "__main__": 357 if __name__ == "__main__":
358 unittest.main() 358 unittest.main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698