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

Side by Side Diff: client/bin/harness_unittest.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 | « client/bin/harness_standalone.py ('k') | client/bin/job.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 #!/usr/bin/python 1 #!/usr/bin/python
2 import unittest 2 import unittest
3 import common 3 import common
4 from autotest_lib.client.common_lib.test_utils import mock 4 from autotest_lib.client.common_lib.test_utils import mock
5 from autotest_lib.client.bin import harness, harness_standalone, harness_ABAT 5 from autotest_lib.client.bin import harness, harness_standalone, harness_ABAT
6 6
7 7
8 class harness_unittest(unittest.TestCase): 8 class harness_unittest(unittest.TestCase):
9 def setUp(self): 9 def setUp(self):
10 self.god = mock.mock_god() 10 self.god = mock.mock_god()
11 11
12 12
13 def tearDown(self): 13 def tearDown(self):
14 self.god.unstub_all() 14 self.god.unstub_all()
15 15
16 16
17 def test_select_none(self): 17 def test_select_none(self):
18 job = object() 18 job = object()
19 self.god.stub_class(harness_standalone, "harness_standalone") 19 self.god.stub_class(harness_standalone, "harness_standalone")
20 20
21 harness_standalone.harness_standalone.expect_new(job) 21 harness_args = ''
22 harness.select(None, job) 22 harness_standalone.harness_standalone.expect_new(job, harness_args)
23 harness.select(None, job, harness_args)
23 self.god.check_playback() 24 self.god.check_playback()
24 25
25 26
26 def test_select_standalone(self): 27 def test_select_standalone(self):
27 job = object() 28 job = object()
28 self.god.stub_class(harness_standalone, "harness_standalone") 29 self.god.stub_class(harness_standalone, "harness_standalone")
29 30
30 harness_standalone.harness_standalone.expect_new(job) 31 harness_args = ''
31 harness.select('standalone', job) 32 harness_standalone.harness_standalone.expect_new(job, harness_args)
33 harness.select('standalone', job, harness_args)
32 self.god.check_playback() 34 self.god.check_playback()
33 35
34 36
35 def test_select_ABAT(self): 37 def test_select_ABAT(self):
36 job = object() 38 job = object()
37 self.god.stub_class(harness_ABAT, "harness_ABAT") 39 self.god.stub_class(harness_ABAT, "harness_ABAT")
38 40
39 harness_ABAT.harness_ABAT.expect_new(job) 41 harness_args = ''
40 harness.select('ABAT', job) 42 harness_ABAT.harness_ABAT.expect_new(job, harness_args)
43 harness.select('ABAT', job, harness_args)
41 self.god.check_playback() 44 self.god.check_playback()
42 45
43 46
44 if __name__ == "__main__": 47 if __name__ == "__main__":
45 unittest.main() 48 unittest.main()
OLDNEW
« no previous file with comments | « client/bin/harness_standalone.py ('k') | client/bin/job.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698