# delete_volume is (context, status, unmanageOnly)
self.assertEqual(1, mock_rpcapi.call_count)
self.assertEqual(3, len(mock_rpcapi.call_args[0]))
- self.assertEqual(True, mock_rpcapi.call_args[0][2])
+ self.assertTrue(mock_rpcapi.call_args[0][2])
self.assertEqual(202, res.status_int, res)
# Try setting it to a string and ensure it becomes a selector
elem.text = 'test'
- self.assertEqual(True, hasattr(elem.text, 'chain'))
+ self.assertTrue(hasattr(elem.text, 'chain'))
self.assertEqual(1, len(elem.text.chain))
self.assertEqual('test', elem.text.chain[0])
# Construct a slave template with applicable minimum version
slave = xmlutil.SlaveTemplate(elem, 2)
- self.assertEqual(True, slave.apply(master))
+ self.assertTrue(slave.apply(master))
# Construct a slave template with equal minimum version
slave = xmlutil.SlaveTemplate(elem, 3)
- self.assertEqual(True, slave.apply(master))
+ self.assertTrue(slave.apply(master))
# Construct a slave template with inapplicable minimum version
slave = xmlutil.SlaveTemplate(elem, 4)
- self.assertEqual(False, slave.apply(master))
+ self.assertFalse(slave.apply(master))
# Construct a slave template with applicable version range
slave = xmlutil.SlaveTemplate(elem, 2, 4)
- self.assertEqual(True, slave.apply(master))
+ self.assertTrue(slave.apply(master))
# Construct a slave template with low version range
slave = xmlutil.SlaveTemplate(elem, 1, 2)
- self.assertEqual(False, slave.apply(master))
+ self.assertFalse(slave.apply(master))
# Construct a slave template with high version range
slave = xmlutil.SlaveTemplate(elem, 4, 5)
- self.assertEqual(False, slave.apply(master))
+ self.assertFalse(slave.apply(master))
# Construct a slave template with matching version range
slave = xmlutil.SlaveTemplate(elem, 3, 3)
- self.assertEqual(True, slave.apply(master))
+ self.assertTrue(slave.apply(master))
def test__serialize(self):
# Our test object to serialize
self.assertEqual(1, len(image_metas))
self.assertEqual('test image', image_metas[0]['name'])
- self.assertEqual(False, image_metas[0]['is_public'])
+ self.assertFalse(image_metas[0]['is_public'])
def test_detail_marker(self):
fixtures = []
def test_backend_exists(self, mock_request):
mock_request.side_effect = [exception.DotHillRequestError,
fake_xml]
- self.assertEqual(False, self.client.backend_exists('backend_name',
- 'linear'))
- self.assertEqual(True, self.client.backend_exists('backend_name',
- 'linear'))
+ self.assertFalse(self.client.backend_exists('backend_name',
+ 'linear'))
+ self.assertTrue(self.client.backend_exists('backend_name',
+ 'linear'))
@mock.patch.object(dothill.DotHillClient, '_request')
def test_backend_stats(self, mock_request):
mock_retype.side_effect = [exception.Invalid, True, False]
args = [None, None, None, None, None]
self.assertRaises(exception.Invalid, self.driver.retype, *args)
- self.assertEqual(True, self.driver.retype(*args))
- self.assertEqual(False, self.driver.retype(*args))
+ self.assertTrue(self.driver.retype(*args))
+ self.assertFalse(self.driver.retype(*args))
@mock.patch.object(dothill_common.DotHillCommon, 'manage_existing')
def test_manage_existing(self, mock_manage_existing):
self.assertEqual(GOODNESS_FUNCTION, stats['goodness_function'])
self.assertEqual(FILTER_FUNCTION, stats['filter_function'])
self.assertEqual(1, int(stats['total_volumes']))
- self.assertEqual(True, stats['thin_provisioning_support'])
- self.assertEqual(True, stats['thick_provisioning_support'])
+ self.assertTrue(stats['thin_provisioning_support'])
+ self.assertTrue(stats['thick_provisioning_support'])
self.assertEqual(1, int(stats['provisioned_capacity_gb']))
cap_util = (
mountpoint2, 'ro')
vol = db.volume_get(context.get_admin_context(), volume_id)
self.assertEqual('in-use', vol['status'])
- self.assertEqual(True, vol['multiattach'])
+ self.assertTrue(vol['multiattach'])
self.assertEqual('attached', attachment2['attach_status'])
self.assertEqual(mountpoint2, attachment2['mountpoint'])
self.assertEqual(instance2_uuid, attachment2['instance_uuid'])
mountpoint2, 'ro')
vol = db.volume_get(context.get_admin_context(), volume_id)
self.assertEqual('in-use', vol['status'])
- self.assertEqual(True, vol['multiattach'])
+ self.assertTrue(vol['multiattach'])
self.assertIsNone(attachment2)
self.assertRaises(exception.VolumeAttached,
with mock.patch.object(drv, '_get_capacity_info',
return_value = cap_info):
ret = drv._is_share_eligible(self._FAKE_SHARE, 50)
- self.assertEqual(False, ret)
+ self.assertFalse(ret)
def test_is_share_eligible_true(self):
drv = self._vz_driver
with mock.patch.object(drv, '_get_capacity_info',
return_value = cap_info):
ret = drv._is_share_eligible(self._FAKE_SHARE, 30)
- self.assertEqual(True, ret)
+ self.assertTrue(ret)
@mock.patch.object(image_utils, 'resize_image')
def test_extend_volume(self, mock_resize_image):
# Check the returned provider
expected_pid = {'provider_id': 'volume10'}
self.assertDictMatch(expected_pid, ret)
- self.assertEqual(True, self._request_cancel)
+ self.assertTrue(self._request_cancel)
@mock.patch('socket.gethostbyname', return_value='123.123.123.123')
def test_create_volume_blocked_and_fail(self, mock_ghn):
self._return_blocked = 2 # Block & pass cancel => create failed. :(
self.assertRaises(exception.VolumeDriverException,
self.driver.create_volume, volume)
- self.assertEqual(True, self._request_cancel)
+ self.assertTrue(self._request_cancel)
def test_delete_volume(self):
"""Test deleting existing volume, ensure proper name used."""
self._fail_extend = True
self.assertRaises(exception.VolumeDriverException,
self.driver.extend_volume, volume, 12)
- self.assertEqual(False, self._request_cancel)
+ self.assertFalse(self._request_cancel)
@mock.patch('socket.gethostbyname', return_value='123.123.123.123')
def test_initialize_connection(self, moch_ghn):