Fix broken unit tests for get_ilo_object
First, the tested function signature was wrong. We didn't catch it in gate, as we mock proliantutils, but it does break e.g. Debian package build. Second, the arguments override was not actually working. We didn't catch it in gate, because the new values were the same as the defaults. Closes-Bug: #1626089 Change-Id: I2e4899e368b0b882dcd59bf33fdca98f47e5b405
This commit is contained in:
parent
2351d624ae
commit
8732780377
|
@ -154,9 +154,10 @@ class IloCommonMethodsTestCase(db_base.DbTestCase):
|
|||
@mock.patch.object(ilo_client, 'IloClient', spec_set=True,
|
||||
autospec=True)
|
||||
def _test_get_ilo_object(self, ilo_client_mock, isFile_mock, ca_file=None):
|
||||
self.info['client_timeout'] = 60
|
||||
self.info['client_port'] = 443
|
||||
self.info['client_timeout'] = 600
|
||||
self.info['client_port'] = 4433
|
||||
self.info['ca_file'] = ca_file
|
||||
self.node.driver_info = self.info
|
||||
ilo_client_mock.return_value = 'ilo_object'
|
||||
returned_ilo_object = ilo_common.get_ilo_object(self.node)
|
||||
ilo_client_mock.assert_called_with(
|
||||
|
@ -164,7 +165,8 @@ class IloCommonMethodsTestCase(db_base.DbTestCase):
|
|||
self.info['ilo_username'],
|
||||
self.info['ilo_password'],
|
||||
self.info['client_timeout'],
|
||||
self.info['client_port'])
|
||||
self.info['client_port'],
|
||||
cacert=self.info['ca_file'])
|
||||
self.assertEqual('ilo_object', returned_ilo_object)
|
||||
|
||||
def test_get_ilo_object_cafile(self):
|
||||
|
|
Loading…
Reference in New Issue