Minor docstring and unittests fixes for IPMIConsole

This is the follow-up patch of the commit
857372a226. This fix follows
some minor comments of Lucas and Ruby from patch set 29 at the
review: https://review.openstack.org/#/c/293873/. The changes are:

* Fix the docstring of the _start_console() in ipmitool.py to reflect
  the real parameters being passed to the method.

* Fix few unittests to use self.assertFalse(<mock>.called) instead of
  self.assertFalse(<mock>.call_count)

Change-Id: I25caa9202c8bc867973205d2bf9642064d3ba492
This commit is contained in:
Dao Cong Tien 2016-08-01 15:20:51 +07:00 committed by Lucas Alvares Gomes
parent c35ba34707
commit c81bd9e5c7
2 changed files with 3 additions and 3 deletions

View File

@ -1135,7 +1135,7 @@ class IPMIConsole(base.ConsoleInterface):
def _start_console(self, driver_info, start_method):
"""Start a remote console for the node.
:param task: a task from TaskManager
:param driver_info: the parameters for accessing a node
:param start_method: console_utils method to start console
:raises: InvalidParameterValue if required ipmi parameters are missing
:raises: PasswordFileFailedToCreate if unable to create a file

View File

@ -193,7 +193,7 @@ class IPMIToolCheckInitTestCase(base.TestCase):
ipmi.TMP_DIR_CHECKED = True
ipmi.IPMISocatConsole()
mock_support.assert_called_with(mock.ANY)
self.assertFalse(mock_check_dir.call_count)
self.assertFalse(mock_check_dir.called)
@mock.patch.object(ipmi, '_is_option_supported', autospec=True)
@ -2236,7 +2236,7 @@ class IPMIToolSocatDriverTestCase(IPMIToolDriverTestCase):
mock_stop.assert_called_once_with(self.node.uuid)
mock_unlink.assert_called_once_with(
ipmi._console_pwfile_path(self.node.uuid))
self.assertFalse(mock_exec_stop.call_count)
self.assertFalse(mock_exec_stop.called)
@mock.patch.object(ipmi, '_exec_ipmitool', autospec=True)
def test__exec_stop_console(self, mock_exec):