Merge "Tests: Fix invalid assert_called_once calls in driver tests"
This commit is contained in:
commit
4b8e596e7b
@ -913,8 +913,9 @@ class DellSCSanISCSIDriverTestCase(test.TestCase):
|
||||
data = self.driver.initialize_connection(volume, connector)
|
||||
self.assertEqual('iscsi', data['driver_volume_type'])
|
||||
# verify find_volume has been called and that is has been called twice
|
||||
mock_find_volume.called_once_with(fake.VOLUME_ID, provider_id)
|
||||
mock_get_volume.called_once_with(provider_id)
|
||||
mock_find_volume.assert_called_once_with(fake.VOLUME_ID, provider_id,
|
||||
False)
|
||||
mock_get_volume.assert_called_once_with(provider_id)
|
||||
props = self.ISCSI_PROPERTIES.copy()
|
||||
expected = {'data': props,
|
||||
'driver_volume_type': 'iscsi'}
|
||||
|
@ -388,7 +388,7 @@ class QuobyteDriverTestCase(test.TestCase):
|
||||
|
||||
mock_execute.assert_has_calls(
|
||||
[mount_call], any_order=False)
|
||||
mock_validate.called_once_with(self.TEST_MNT_POINT)
|
||||
mock_validate.assert_called_once_with(self.TEST_MNT_POINT)
|
||||
|
||||
def test_mount_quobyte_already_mounted_detected_seen_in_proc_mount(self):
|
||||
with mock.patch('cinder.volume.drivers.quobyte.QuobyteDriver'
|
||||
|
@ -744,9 +744,6 @@ class RemoteFsSnapDriverTestCase(test.TestCase):
|
||||
'volume_type_id': src_vref.volume_type_id,
|
||||
'encryption_key_id': None,
|
||||
}
|
||||
snap_args_deletion = snap_args_creation.copy()
|
||||
snap_args_deletion["status"] = fields.SnapshotStatus.DELETED
|
||||
snap_args_deletion["deleted"] = True
|
||||
|
||||
mock_obj_snap.return_value = mock.Mock()
|
||||
mock_obj_snap.return_value.create = mock.Mock()
|
||||
@ -771,7 +768,8 @@ class RemoteFsSnapDriverTestCase(test.TestCase):
|
||||
mock_copy_volume_from_snapshot.assert_called_once_with(
|
||||
mock_obj_snap.return_value, volume_ref, volume['size'],
|
||||
src_encryption_key_id=None, new_encryption_key_id=None)
|
||||
mock_delete_snapshot.called_once_with(snap_args_deletion)
|
||||
mock_delete_snapshot.assert_called_once_with(
|
||||
mock_obj_snap.return_value)
|
||||
else:
|
||||
self.assertFalse(mock_create_snapshot.called)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user