Home | History | Annotate | Download | only in bin
      1 #!/usr/bin/python
      2 # pylint: disable=missing-docstring
      3 
      4 import unittest
      5 import common
      6 from autotest_lib.client.common_lib.test_utils import mock
      7 from autotest_lib.client.bin import harness, harness_standalone
      8 
      9 
     10 class harness_unittest(unittest.TestCase):
     11     def setUp(self):
     12         self.god = mock.mock_god()
     13 
     14 
     15     def tearDown(self):
     16         self.god.unstub_all()
     17 
     18 
     19     def test_select_none(self):
     20         job = object()
     21         self.god.stub_class(harness_standalone, "harness_standalone")
     22 
     23         harness_args = ''
     24         harness_standalone.harness_standalone.expect_new(job, harness_args)
     25         harness.select(None, job, harness_args)
     26         self.god.check_playback()
     27 
     28 
     29     def test_select_standalone(self):
     30         job = object()
     31         self.god.stub_class(harness_standalone, "harness_standalone")
     32 
     33         harness_args = ''
     34         harness_standalone.harness_standalone.expect_new(job, harness_args)
     35         harness.select('standalone', job, harness_args)
     36         self.god.check_playback()
     37 
     38 
     39 if  __name__ == "__main__":
     40     unittest.main()
     41