OLD | NEW |
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() |
OLD | NEW |