Change assertTrue(isinstance()) with optimal assert

Some of tests use different method of assertTrue(isinstance(A, B))
The correct way is to use assertIsInstance(A, B) provided by testtools

Change-Id: Iaa27afbd59ed00a8254df96794f0c38bc408a239
changes/58/364158/1
Ji-Wei 6 years ago
parent ee0e9d166e
commit 9b561506d5
  1. 4
      os_brick/tests/initiator/connectors/test_rbd.py
  2. 4
      os_brick/tests/initiator/connectors/test_sheepdog.py

@ -89,8 +89,8 @@ class RBDConnectorTestCase(test_connector.ConnectorTestCase):
snapshot=None)
# Ensure expected object is returned correctly
self.assertTrue(isinstance(device_info['path'],
linuxrbd.RBDVolumeIOWrapper))
self.assertIsInstance(device_info['path'],
linuxrbd.RBDVolumeIOWrapper)
@mock.patch('os_brick.initiator.connectors.rbd.tempfile.mkstemp')
def test_create_ceph_conf(self, mock_mkstemp):

@ -59,8 +59,8 @@ class SheepdogConnectorTestCase(test_connector.ConnectorTestCase):
device_info = sd_connector.connect_volume(self.connection_properties)
# Ensure expected object is returned correctly
self.assertTrue(isinstance(device_info['path'],
linuxsheepdog.SheepdogVolumeIOWrapper))
self.assertIsInstance(device_info['path'],
linuxsheepdog.SheepdogVolumeIOWrapper)
@mock.patch.object(linuxsheepdog.SheepdogVolumeIOWrapper, 'close')
def test_disconnect_volume(self, volume_close):

Loading…
Cancel
Save