Remove unnecessary checks already coverd in schema
This is to remove the unnecessary assertIn checks which is already covered in schema checks. Change-Id: I223a4f2d80e33fd60ecc3a8d24e93f5e80f8d0bf
This commit is contained in:
parent
98c5c1e89e
commit
78c9139dd2
@ -169,7 +169,6 @@ class QuotaClassesAdminTestJSON(base.BaseV2ComputeAdminTest):
|
||||
LOG.debug("get the current 'default' quota class values")
|
||||
body = (self.adm_client.show_quota_class_set('default')
|
||||
['quota_class_set'])
|
||||
self.assertIn('id', body)
|
||||
self.assertEqual('default', body.pop('id'))
|
||||
# restore the defaults when the test is done
|
||||
self.addCleanup(self._restore_default_quotas, body.copy())
|
||||
|
@ -31,14 +31,9 @@ class CertificatesV2TestJSON(base.BaseV2ComputeTest):
|
||||
@decorators.idempotent_id('c070a441-b08e-447e-a733-905909535b1b')
|
||||
def test_create_root_certificate(self):
|
||||
# create certificates
|
||||
body = self.certificates_client.create_certificate()['certificate']
|
||||
self.assertIn('data', body)
|
||||
self.assertIn('private_key', body)
|
||||
self.certificates_client.create_certificate()
|
||||
|
||||
@decorators.idempotent_id('3ac273d0-92d2-4632-bdfc-afbc21d4606c')
|
||||
def test_get_root_certificate(self):
|
||||
# get the root certificate
|
||||
body = (self.certificates_client.show_certificate('root')
|
||||
['certificate'])
|
||||
self.assertIn('data', body)
|
||||
self.assertIn('private_key', body)
|
||||
self.certificates_client.show_certificate('root')
|
||||
|
@ -65,8 +65,6 @@ class KeyPairsV2TestJSON(base.BaseKeypairTest):
|
||||
k_name = data_utils.rand_name('keypair')
|
||||
self.create_keypair(k_name)
|
||||
keypair_detail = self.client.show_keypair(k_name)['keypair']
|
||||
self.assertIn('name', keypair_detail)
|
||||
self.assertIn('public_key', keypair_detail)
|
||||
self.assertEqual(keypair_detail['name'], k_name,
|
||||
"The created keypair name is not equal "
|
||||
"to requested name")
|
||||
|
@ -69,7 +69,6 @@ class SecurityGroupsTestJSON(base.BaseSecurityGroupsTest):
|
||||
# leading and trailing spaces
|
||||
s_name = ' %s ' % data_utils.rand_name('securitygroup ')
|
||||
securitygroup = self.create_security_group(name=s_name)
|
||||
self.assertIn('name', securitygroup)
|
||||
securitygroup_name = securitygroup['name']
|
||||
self.assertEqual(securitygroup_name, s_name,
|
||||
"The created Security Group name is "
|
||||
@ -131,7 +130,6 @@ class SecurityGroupsTestJSON(base.BaseSecurityGroupsTest):
|
||||
# Update security group name and description
|
||||
# Create a security group
|
||||
securitygroup = self.create_security_group()
|
||||
self.assertIn('id', securitygroup)
|
||||
securitygroup_id = securitygroup['id']
|
||||
# Update the name and description
|
||||
s_new_name = data_utils.rand_name('sg-hth')
|
||||
|
@ -154,7 +154,6 @@ class SecurityGroupsNegativeTestJSON(base.BaseSecurityGroupsTest):
|
||||
def test_update_security_group_with_invalid_sg_name(self):
|
||||
# Update security_group with invalid sg_name should fail
|
||||
securitygroup = self.create_security_group()
|
||||
self.assertIn('id', securitygroup)
|
||||
securitygroup_id = securitygroup['id']
|
||||
# Update Security Group with group name longer than 255 chars
|
||||
s_new_name = 'securitygroup-'.ljust(260, '0')
|
||||
@ -170,7 +169,6 @@ class SecurityGroupsNegativeTestJSON(base.BaseSecurityGroupsTest):
|
||||
def test_update_security_group_with_invalid_sg_des(self):
|
||||
# Update security_group with invalid sg_des should fail
|
||||
securitygroup = self.create_security_group()
|
||||
self.assertIn('id', securitygroup)
|
||||
securitygroup_id = securitygroup['id']
|
||||
# Update Security Group with group description longer than 255 chars
|
||||
s_new_des = 'des-'.ljust(260, '0')
|
||||
|
@ -52,8 +52,6 @@ class VolumesGetTestJSON(base.BaseV2ComputeTest):
|
||||
volume = self.create_volume(size=CONF.volume.volume_size,
|
||||
display_name=v_name,
|
||||
metadata=metadata)
|
||||
self.assertIn('id', volume)
|
||||
self.assertIn('displayName', volume)
|
||||
self.assertEqual(volume['displayName'], v_name,
|
||||
"The created volume name is not equal "
|
||||
"to the requested name")
|
||||
|
Loading…
Reference in New Issue
Block a user