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