Fix wrong assertion methods
Replace 'called_once_with' with 'assert_called_once_with'. Change-Id: I18b55da0d1f142818e7ea14f6eebcc0f0f0cd23f Closes-Bug: 1989280 Signed-off-by: Takashi Natsume <takanattie@gmail.com>
This commit is contained in:
parent
655fcc41b3
commit
e7b1426e31
@ -702,7 +702,7 @@ class ISCSIConnectorTestCase(test_connector.ConnectorTestCase):
|
|||||||
force=False, ignore_errors=False,
|
force=False, ignore_errors=False,
|
||||||
device_info=mock.sentinel.device_info)
|
device_info=mock.sentinel.device_info)
|
||||||
|
|
||||||
get_dev_path_mock.called_once_with(self.CON_PROPS,
|
get_dev_path_mock.assert_called_once_with(self.CON_PROPS,
|
||||||
mock.sentinel.device_info)
|
mock.sentinel.device_info)
|
||||||
con_devs_mock.assert_called_once_with(self.CON_PROPS,
|
con_devs_mock.assert_called_once_with(self.CON_PROPS,
|
||||||
mock.sentinel.ips_iqns_luns,
|
mock.sentinel.ips_iqns_luns,
|
||||||
|
@ -1430,9 +1430,9 @@ class NVMeOFConnectorTestCase(test_connector.ConnectorTestCase):
|
|||||||
mock_find_dev.assert_called_once_with()
|
mock_find_dev.assert_called_once_with()
|
||||||
|
|
||||||
portal = target.portals[-1]
|
portal = target.portals[-1]
|
||||||
mock_cli.called_once_with(['connect', '-a', portal.address,
|
mock_cli.assert_called_once_with([
|
||||||
'-s', portal.port, '-t', portal.transport,
|
'connect', '-a', portal.address, '-s', portal.port, '-t',
|
||||||
'-n', target.nqn, '-Q', '128', '-l', '-1',
|
portal.transport, '-n', target.nqn, '-Q', '128', '-l', '-1',
|
||||||
'-q', 'host_nqn'])
|
'-q', 'host_nqn'])
|
||||||
|
|
||||||
@mock.patch.object(nvmeof.NVMeOFConnector, '_do_multipath',
|
@mock.patch.object(nvmeof.NVMeOFConnector, '_do_multipath',
|
||||||
@ -1497,9 +1497,9 @@ class NVMeOFConnectorTestCase(test_connector.ConnectorTestCase):
|
|||||||
mock_find_dev.assert_called_once_with()
|
mock_find_dev.assert_called_once_with()
|
||||||
|
|
||||||
portal = target.portals[-1]
|
portal = target.portals[-1]
|
||||||
mock_cli.called_once_with(['connect', '-a', portal.address,
|
mock_cli.assert_called_once_with([
|
||||||
'-s', portal.port, '-t', portal.transport,
|
'connect', '-a', portal.address, '-s', portal.port, '-t',
|
||||||
'-n', target.nqn, '-Q', '128', '-l', '-1'])
|
portal.transport, '-n', target.nqn, '-Q', '128', '-l', '-1'])
|
||||||
self.assertEqual(1, mock_log.call_count)
|
self.assertEqual(1, mock_log.call_count)
|
||||||
|
|
||||||
@mock.patch.object(nvmeof.NVMeOFConnector, 'stop_and_assemble_raid')
|
@mock.patch.object(nvmeof.NVMeOFConnector, 'stop_and_assemble_raid')
|
||||||
|
@ -358,7 +358,7 @@ class RBDConnectorTestCase(test_base_rbd.RBDConnectorTestMixin,
|
|||||||
rbd_connector.disconnect_volume(conn, None)
|
rbd_connector.disconnect_volume(conn, None)
|
||||||
|
|
||||||
# Assert that only showmapped is called when no mappings are found
|
# Assert that only showmapped is called when no mappings are found
|
||||||
mock_execute.called_once_with(*show_cmd, root_helper=None,
|
mock_execute.assert_called_once_with(*show_cmd, root_helper=None,
|
||||||
run_as_root=True)
|
run_as_root=True)
|
||||||
|
|
||||||
@mock.patch.object(priv_rootwrap, 'execute', return_value=None)
|
@mock.patch.object(priv_rootwrap, 'execute', return_value=None)
|
||||||
@ -374,7 +374,7 @@ class RBDConnectorTestCase(test_base_rbd.RBDConnectorTestMixin,
|
|||||||
rbd_connector.disconnect_volume(conn, None)
|
rbd_connector.disconnect_volume(conn, None)
|
||||||
|
|
||||||
# Assert that only showmapped is called when no mappings are found
|
# Assert that only showmapped is called when no mappings are found
|
||||||
mock_execute.called_once_with(*show_cmd, root_helper=None,
|
mock_execute.assert_called_once_with(*show_cmd, root_helper=None,
|
||||||
run_as_root=True)
|
run_as_root=True)
|
||||||
|
|
||||||
@mock.patch('oslo_utils.fileutils.delete_if_exists')
|
@mock.patch('oslo_utils.fileutils.delete_if_exists')
|
||||||
|
Loading…
Reference in New Issue
Block a user