diff --git a/os_brick/tests/initiator/connectors/test_iscsi.py b/os_brick/tests/initiator/connectors/test_iscsi.py index 4c936308b..00109bc82 100644 --- a/os_brick/tests/initiator/connectors/test_iscsi.py +++ b/os_brick/tests/initiator/connectors/test_iscsi.py @@ -702,8 +702,8 @@ class ISCSIConnectorTestCase(test_connector.ConnectorTestCase): force=False, ignore_errors=False, device_info=mock.sentinel.device_info) - get_dev_path_mock.called_once_with(self.CON_PROPS, - mock.sentinel.device_info) + get_dev_path_mock.assert_called_once_with(self.CON_PROPS, + mock.sentinel.device_info) con_devs_mock.assert_called_once_with(self.CON_PROPS, mock.sentinel.ips_iqns_luns, False) diff --git a/os_brick/tests/initiator/connectors/test_nvmeof.py b/os_brick/tests/initiator/connectors/test_nvmeof.py index e75f81152..f14e626c9 100644 --- a/os_brick/tests/initiator/connectors/test_nvmeof.py +++ b/os_brick/tests/initiator/connectors/test_nvmeof.py @@ -1430,10 +1430,10 @@ class NVMeOFConnectorTestCase(test_connector.ConnectorTestCase): mock_find_dev.assert_called_once_with() portal = target.portals[-1] - mock_cli.called_once_with(['connect', '-a', portal.address, - '-s', portal.port, '-t', portal.transport, - '-n', target.nqn, '-Q', '128', '-l', '-1', - '-q', 'host_nqn']) + mock_cli.assert_called_once_with([ + 'connect', '-a', portal.address, '-s', portal.port, '-t', + portal.transport, '-n', target.nqn, '-Q', '128', '-l', '-1', + '-q', 'host_nqn']) @mock.patch.object(nvmeof.NVMeOFConnector, '_do_multipath', mock.Mock(return_value=True)) @@ -1497,9 +1497,9 @@ class NVMeOFConnectorTestCase(test_connector.ConnectorTestCase): mock_find_dev.assert_called_once_with() portal = target.portals[-1] - mock_cli.called_once_with(['connect', '-a', portal.address, - '-s', portal.port, '-t', portal.transport, - '-n', target.nqn, '-Q', '128', '-l', '-1']) + mock_cli.assert_called_once_with([ + 'connect', '-a', portal.address, '-s', portal.port, '-t', + portal.transport, '-n', target.nqn, '-Q', '128', '-l', '-1']) self.assertEqual(1, mock_log.call_count) @mock.patch.object(nvmeof.NVMeOFConnector, 'stop_and_assemble_raid') diff --git a/os_brick/tests/initiator/connectors/test_rbd.py b/os_brick/tests/initiator/connectors/test_rbd.py index b49683e02..935cafc8c 100644 --- a/os_brick/tests/initiator/connectors/test_rbd.py +++ b/os_brick/tests/initiator/connectors/test_rbd.py @@ -358,8 +358,8 @@ class RBDConnectorTestCase(test_base_rbd.RBDConnectorTestMixin, rbd_connector.disconnect_volume(conn, None) # Assert that only showmapped is called when no mappings are found - mock_execute.called_once_with(*show_cmd, root_helper=None, - run_as_root=True) + mock_execute.assert_called_once_with(*show_cmd, root_helper=None, + run_as_root=True) @mock.patch.object(priv_rootwrap, 'execute', return_value=None) def test_disconnect_local_volume_no_mappings(self, mock_execute): @@ -374,8 +374,8 @@ class RBDConnectorTestCase(test_base_rbd.RBDConnectorTestMixin, rbd_connector.disconnect_volume(conn, None) # Assert that only showmapped is called when no mappings are found - mock_execute.called_once_with(*show_cmd, root_helper=None, - run_as_root=True) + mock_execute.assert_called_once_with(*show_cmd, root_helper=None, + run_as_root=True) @mock.patch('oslo_utils.fileutils.delete_if_exists') @mock.patch.object(rbd.RBDConnector, '_get_rbd_handle')