Browse Source

[Unity] Fix TypeError for test case test_delete_host_wo_lock

Fix TypeError "'NoneType' object is not callable" in test case
test_delete_host_wo_lock

Change-Id: I44650912e88808ce56b347633093e05d5741252c
Closes-bug: #1867619
(cherry picked from commit f88845d756)
(cherry picked from commit c5f4e6aff5)
(cherry picked from commit 25a43b4872)
changes/56/716156/1
Yong Huang 3 months ago
parent
commit
78af5f869e
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      cinder/tests/unit/volume/drivers/dell_emc/unity/test_client.py

+ 3
- 2
cinder/tests/unit/volume/drivers/dell_emc/unity/test_client.py View File

@@ -65,7 +65,7 @@ class MockResource(object):
raise ex.UnityResourceNotFoundError()
elif self.get_id() == 'snap_in_use':
raise ex.UnityDeleteAttachedSnapError()
elif self.name == 'empty_host':
elif self.name == 'empty-host':
raise ex.HostDeleteIsCalled()

@property
@@ -564,7 +564,8 @@ class ClientTest(unittest.TestCase):
host = MockResource(name='empty-host')
self.client.host_cache['empty-host'] = host
self.assertRaises(ex.HostDeleteIsCalled,
self.client.delete_host_wo_lock(host))
self.client.delete_host_wo_lock,
host)

def test_delete_host_wo_lock_remove_from_cache(self):
host = MockResource(name='empty-host-in-cache')


Loading…
Cancel
Save