Replace assertEqual(None, *) with assertIsNone in tests
Replace assertEqual(None, *) with assertIsNone in tests to have more clear messages in case of failure. Change-Id: Ie57df9cefb961b0e55cd2483cd00b31eef296a0b Closes-Bug: #1584736
This commit is contained in:
parent
85db3cdd37
commit
67f1f033b0
@ -345,7 +345,7 @@ class CephFSNativeDriverTestCase(test.TestCase):
|
|||||||
vc.disconnect.assert_called_once_with()
|
vc.disconnect.assert_called_once_with()
|
||||||
|
|
||||||
def test_delete_driver_no_client(self):
|
def test_delete_driver_no_client(self):
|
||||||
self.assertEqual(None, self._driver._volume_client)
|
self.assertIsNone(self._driver._volume_client)
|
||||||
del self._driver
|
del self._driver
|
||||||
|
|
||||||
def test_connect_noevict(self):
|
def test_connect_noevict(self):
|
||||||
|
@ -354,7 +354,7 @@ class GlusterfsVolumeMappedLayoutTestCase(test.TestCase):
|
|||||||
|
|
||||||
self._layout.private_storage.get.assert_called_once_with(
|
self._layout.private_storage.get.assert_called_once_with(
|
||||||
self.share1['id'], 'volume')
|
self.share1['id'], 'volume')
|
||||||
self.assertEqual(None, ret)
|
self.assertIsNone(ret)
|
||||||
|
|
||||||
def test_ensure_share(self):
|
def test_ensure_share(self):
|
||||||
share = self.share1
|
share = self.share1
|
||||||
|
@ -2159,7 +2159,7 @@ class NetAppFileStorageLibraryTestCase(test.TestCase):
|
|||||||
fake.SHARE,
|
fake.SHARE,
|
||||||
[],
|
[],
|
||||||
share_server=None)
|
share_server=None)
|
||||||
self.assertEqual(None, result)
|
self.assertIsNone(result)
|
||||||
mock_dm_session.delete_snapmirror.assert_called_with(fake.SHARE,
|
mock_dm_session.delete_snapmirror.assert_called_with(fake.SHARE,
|
||||||
fake.SHARE)
|
fake.SHARE)
|
||||||
self.assertEqual(2, mock_dm_session.delete_snapmirror.call_count)
|
self.assertEqual(2, mock_dm_session.delete_snapmirror.call_count)
|
||||||
@ -2186,7 +2186,7 @@ class NetAppFileStorageLibraryTestCase(test.TestCase):
|
|||||||
fake.SHARE,
|
fake.SHARE,
|
||||||
[],
|
[],
|
||||||
share_server=fake.SHARE_SERVER)
|
share_server=fake.SHARE_SERVER)
|
||||||
self.assertEqual(None, result)
|
self.assertIsNone(result)
|
||||||
mock_dm_session.delete_snapmirror.assert_called_with(fake.SHARE,
|
mock_dm_session.delete_snapmirror.assert_called_with(fake.SHARE,
|
||||||
fake.SHARE)
|
fake.SHARE)
|
||||||
self.assertEqual(2, mock_dm_session.delete_snapmirror.call_count)
|
self.assertEqual(2, mock_dm_session.delete_snapmirror.call_count)
|
||||||
@ -2215,7 +2215,7 @@ class NetAppFileStorageLibraryTestCase(test.TestCase):
|
|||||||
[],
|
[],
|
||||||
share_server=None)
|
share_server=None)
|
||||||
|
|
||||||
self.assertEqual(None, result)
|
self.assertIsNone(result)
|
||||||
self.assertFalse(self.library._deallocate_container.called)
|
self.assertFalse(self.library._deallocate_container.called)
|
||||||
mock_dm_session.delete_snapmirror.assert_called_with(fake.SHARE,
|
mock_dm_session.delete_snapmirror.assert_called_with(fake.SHARE,
|
||||||
fake.SHARE)
|
fake.SHARE)
|
||||||
@ -3200,7 +3200,7 @@ class NetAppFileStorageLibraryTestCase(test.TestCase):
|
|||||||
model_update = self.library.update_replicated_snapshot(
|
model_update = self.library.update_replicated_snapshot(
|
||||||
replica_list, self.fake_replica_2, [fake_snapshot], fake_snapshot)
|
replica_list, self.fake_replica_2, [fake_snapshot], fake_snapshot)
|
||||||
|
|
||||||
self.assertEqual(None, model_update)
|
self.assertIsNone(model_update)
|
||||||
self.mock_dm_session.update_snapmirror.assert_called_once_with(
|
self.mock_dm_session.update_snapmirror.assert_called_once_with(
|
||||||
self.fake_replica, self.fake_replica_2
|
self.fake_replica, self.fake_replica_2
|
||||||
)
|
)
|
||||||
@ -3224,7 +3224,7 @@ class NetAppFileStorageLibraryTestCase(test.TestCase):
|
|||||||
model_update = self.library.update_replicated_snapshot(
|
model_update = self.library.update_replicated_snapshot(
|
||||||
replica_list, self.fake_replica_2, [fake_snapshot], fake_snapshot)
|
replica_list, self.fake_replica_2, [fake_snapshot], fake_snapshot)
|
||||||
|
|
||||||
self.assertEqual(None, model_update)
|
self.assertIsNone(model_update)
|
||||||
self.mock_dm_session.update_snapmirror.assert_called_once_with(
|
self.mock_dm_session.update_snapmirror.assert_called_once_with(
|
||||||
self.fake_replica, self.fake_replica_2
|
self.fake_replica, self.fake_replica_2
|
||||||
)
|
)
|
||||||
@ -3250,7 +3250,7 @@ class NetAppFileStorageLibraryTestCase(test.TestCase):
|
|||||||
model_update = self.library.update_replicated_snapshot(
|
model_update = self.library.update_replicated_snapshot(
|
||||||
replica_list, self.fake_replica_2, [fake_snapshot], fake_snapshot)
|
replica_list, self.fake_replica_2, [fake_snapshot], fake_snapshot)
|
||||||
|
|
||||||
self.assertEqual(None, model_update)
|
self.assertIsNone(model_update)
|
||||||
self.mock_dm_session.update_snapmirror.assert_called_once_with(
|
self.mock_dm_session.update_snapmirror.assert_called_once_with(
|
||||||
self.fake_replica, self.fake_replica_2
|
self.fake_replica, self.fake_replica_2
|
||||||
)
|
)
|
||||||
@ -3298,7 +3298,7 @@ class NetAppFileStorageLibraryTestCase(test.TestCase):
|
|||||||
model_update = self.library.update_replicated_snapshot(
|
model_update = self.library.update_replicated_snapshot(
|
||||||
replica_list, self.fake_replica, [fake_snapshot], fake_snapshot)
|
replica_list, self.fake_replica, [fake_snapshot], fake_snapshot)
|
||||||
|
|
||||||
self.assertEqual(None, model_update)
|
self.assertIsNone(model_update)
|
||||||
|
|
||||||
def test_update_replicated_snapshot_created(self):
|
def test_update_replicated_snapshot_created(self):
|
||||||
vserver_client = mock.Mock()
|
vserver_client = mock.Mock()
|
||||||
@ -3382,4 +3382,4 @@ class NetAppFileStorageLibraryTestCase(test.TestCase):
|
|||||||
model_update = self.library.update_replicated_snapshot(
|
model_update = self.library.update_replicated_snapshot(
|
||||||
replica_list, self.fake_replica, [fake_snapshot], fake_snapshot)
|
replica_list, self.fake_replica, [fake_snapshot], fake_snapshot)
|
||||||
|
|
||||||
self.assertEqual(None, model_update)
|
self.assertIsNone(model_update)
|
||||||
|
@ -1448,7 +1448,7 @@ class ShareManagerTestCase(test.TestCase):
|
|||||||
return_value = self.share_manager.create_snapshot(
|
return_value = self.share_manager.create_snapshot(
|
||||||
self.context, share_id, snapshot_id)
|
self.context, share_id, snapshot_id)
|
||||||
|
|
||||||
self.assertEqual(None, return_value)
|
self.assertIsNone(return_value)
|
||||||
self.share_manager.driver.create_snapshot.assert_called_once_with(
|
self.share_manager.driver.create_snapshot.assert_called_once_with(
|
||||||
self.context, expected_snapshot_instance_dict, share_server=None)
|
self.context, expected_snapshot_instance_dict, share_server=None)
|
||||||
db_update.assert_has_calls(expected_update_calls, any_order=True)
|
db_update.assert_has_calls(expected_update_calls, any_order=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user