Skip to content

Commit

Permalink
Merge "Tighten unit test dict assertions"
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and openstack-gerrit committed Aug 19, 2019
2 parents f69ce58 + 858900f commit 6722bb2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cinder/tests/unit/volume/drivers/dell_emc/test_xtremio.py
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ def test_initialize_connection_after_enabling_chap(self, req):
self.driver.create_volume(self.data.test_volume2)
map_data = self.driver.initialize_connection(self.data.test_volume,
self.data.connector)
self.assertIsNone(map_data['data'].get('access_mode'))
self.assertNotIn('access_mode', map_data['data'])
c1 = xms_data['clusters'][1]
c1['chap-authentication-mode'] = 'initiator'
c1['chap-discovery-mode'] = 'initiator'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4781,7 +4781,7 @@ def test_get_volume_disk_type(self, disk_type_value):
self.assertEqual(disk_type_value['disktype'],
data['pools'][0]['disk_type'])
else:
self.assertIsNone(data['pools'][0].get('disk_type'))
self.assertNotIn('disk_type', data['pools'][0])

def test_get_disk_type_pool_info_none(self):
driver = FakeISCSIStorage(configuration=self.configuration)
Expand All @@ -4790,7 +4790,7 @@ def test_get_disk_type_pool_info_none(self):
self.mock_object(rest_client.RestClient, 'get_pool_info',
return_value=None)
data = driver.get_volume_stats()
self.assertIsNone(data['pools'][0].get('disk_type'))
self.assertNotIn('disk_type', data['pools'][0])

def test_extend_volume(self):
self.driver.extend_volume(self.volume, 3)
Expand Down
4 changes: 2 additions & 2 deletions cinder/tests/unit/volume/drivers/solidfire/test_solidfire.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ def test_create_volume(self,

model_update = sfv.create_volume(testvol)
self.assertIsNotNone(model_update)
self.assertIsNone(model_update.get('provider_geometry', None))
self.assertNotIn('provider_geometry', model_update)

@mock.patch.object(solidfire.SolidFireDriver, '_issue_api_request')
@mock.patch.object(solidfire.SolidFireDriver, '_create_template_account')
Expand Down Expand Up @@ -1318,7 +1318,7 @@ def test_manage_existing_volume(self):
sfv = solidfire.SolidFireDriver(configuration=self.configuration)
model_update = sfv.manage_existing(testvol, external_ref)
self.assertIsNotNone(model_update)
self.assertIsNone(model_update.get('provider_geometry', None))
self.assertNotIn('provider_geometry', model_update)

def test_manage_existing_get_size(self):
external_ref = {'name': 'existing volume', 'source-id': 5}
Expand Down

0 comments on commit 6722bb2

Please sign in to comment.