Fix order of arguments in assertEqual
Some tests used incorrect order assertEqual(observed, expected). The correct order expected by testtools is assertEqual(expected, observed). Partial-Bug: #1259292 Change-Id: If41740753873c58c640e685b92f1968420ce1408
This commit is contained in:
parent
858114bb6b
commit
eb8d4f953c
@ -73,5 +73,5 @@ class FlavorExtraSpecsSampleJsonTests(api_sample_base.ApiSampleTestBaseV3):
|
||||
def test_flavor_extra_specs_delete(self):
|
||||
self._flavor_extra_specs_create()
|
||||
response = self._do_delete('flavors/1/os-extra_specs/key1')
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertEqual(response.content, '')
|
||||
self.assertEqual(200, response.status_code)
|
||||
self.assertEqual('', response.content)
|
||||
|
@ -66,5 +66,5 @@ class FlavorManageSampleJsonTests(api_sample_base.ApiSampleTestBaseV3):
|
||||
# Get api sample to delete a flavor.
|
||||
self._create_flavor()
|
||||
response = self._do_delete("flavors/10")
|
||||
self.assertEqual(response.status_code, 202)
|
||||
self.assertEqual(response.content, '')
|
||||
self.assertEqual(202, response.status_code)
|
||||
self.assertEqual('', response.content)
|
||||
|
@ -73,7 +73,7 @@ class FloatingIpDNSTest(api_sample_base.ApiSampleTestBaseV3):
|
||||
def test_floating_ip_dns_delete(self):
|
||||
self._create_or_update()
|
||||
response = self._do_delete('os-floating-ip-dns/%s' % self.domain)
|
||||
self.assertEqual(response.status_code, 202)
|
||||
self.assertEqual(202, response.status_code)
|
||||
|
||||
def test_floating_ip_dns_create_or_update_entry(self):
|
||||
self._create_or_update_entry()
|
||||
@ -92,7 +92,7 @@ class FloatingIpDNSTest(api_sample_base.ApiSampleTestBaseV3):
|
||||
self._create_or_update_entry()
|
||||
response = self._do_delete('os-floating-ip-dns/%s/entries/%s'
|
||||
% (self.domain, self.name))
|
||||
self.assertEqual(response.status_code, 202)
|
||||
self.assertEqual(202, response.status_code)
|
||||
|
||||
def test_floating_ip_dns_entry_list(self):
|
||||
self._create_or_update_entry()
|
||||
|
@ -113,5 +113,5 @@ class FloatingIpsTest(api_sample_base.ApiSampleTestBaseV3):
|
||||
def test_floating_ips_delete(self):
|
||||
self.test_floating_ips_create()
|
||||
response = self._do_delete('os-floating-ips/%d' % 1)
|
||||
self.assertEqual(response.status_code, 202)
|
||||
self.assertEqual(response.content, "")
|
||||
self.assertEqual(202, response.status_code)
|
||||
self.assertEqual("", response.content)
|
||||
|
@ -86,5 +86,5 @@ class MigrationsSamplesJsonTest(api_sample_base.ApiSampleTestBaseV3):
|
||||
response = self._do_get('os-migrations')
|
||||
subs = self._get_regexes()
|
||||
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertEqual(200, response.status_code)
|
||||
self._verify_response('migrations-get', subs, response, 200)
|
||||
|
@ -49,7 +49,7 @@ class MultinicSampleJsonTest(test_servers.ServersSampleBase):
|
||||
subs = {"networkId": 1}
|
||||
response = self._do_post('servers/%s/action' % (self.uuid),
|
||||
'multinic-add-fixed-ip-req', subs)
|
||||
self.assertEqual(response.status_code, 202)
|
||||
self.assertEqual(202, response.status_code)
|
||||
|
||||
def test_add_fixed_ip(self):
|
||||
self._add_fixed_ip()
|
||||
@ -60,4 +60,4 @@ class MultinicSampleJsonTest(test_servers.ServersSampleBase):
|
||||
subs = {"ip": "10.0.0.4"}
|
||||
response = self._do_post('servers/%s/action' % (self.uuid),
|
||||
'multinic-remove-fixed-ip-req', subs)
|
||||
self.assertEqual(response.status_code, 202)
|
||||
self.assertEqual(202, response.status_code)
|
||||
|
@ -62,8 +62,8 @@ class NetworksJsonTests(api_sample_base.ApiSampleTestBaseV3):
|
||||
uuid = test_networks.FAKE_NETWORKS[0]['uuid']
|
||||
response = self._do_post('os-networks/%s/action' % uuid,
|
||||
'networks-disassociate-req', {})
|
||||
self.assertEqual(response.status_code, 202)
|
||||
self.assertEqual(response.content, "")
|
||||
self.assertEqual(202, response.status_code)
|
||||
self.assertEqual("", response.content)
|
||||
|
||||
def test_network_show(self):
|
||||
uuid = test_networks.FAKE_NETWORKS[0]['uuid']
|
||||
@ -80,10 +80,10 @@ class NetworksJsonTests(api_sample_base.ApiSampleTestBaseV3):
|
||||
def test_network_add(self):
|
||||
response = self._do_post("os-networks/add",
|
||||
'network-add-req', {})
|
||||
self.assertEqual(response.status_code, 202)
|
||||
self.assertEqual(response.content, "")
|
||||
self.assertEqual(202, response.status_code)
|
||||
self.assertEqual("", response.content)
|
||||
|
||||
def test_network_delete(self):
|
||||
response = self._do_delete('os-networks/always_delete')
|
||||
self.assertEqual(response.status_code, 202)
|
||||
self.assertEqual(response.content, "")
|
||||
self.assertEqual(202, response.status_code)
|
||||
self.assertEqual("", response.content)
|
||||
|
@ -55,26 +55,26 @@ class NetworksAssociateJsonTests(api_sample_base.ApiSampleTestBaseV3):
|
||||
response = self._do_post('os-networks/1/action',
|
||||
'network-disassociate-req',
|
||||
{})
|
||||
self.assertEqual(response.status_code, 202)
|
||||
self.assertEqual(response.content, "")
|
||||
self.assertEqual(202, response.status_code)
|
||||
self.assertEqual("", response.content)
|
||||
|
||||
def test_disassociate_host(self):
|
||||
response = self._do_post('os-networks/1/action',
|
||||
'network-disassociate-host-req',
|
||||
{})
|
||||
self.assertEqual(response.status_code, 202)
|
||||
self.assertEqual(response.content, "")
|
||||
self.assertEqual(202, response.status_code)
|
||||
self.assertEqual("", response.content)
|
||||
|
||||
def test_disassociate_project(self):
|
||||
response = self._do_post('os-networks/1/action',
|
||||
'network-disassociate-project-req',
|
||||
{})
|
||||
self.assertEqual(response.status_code, 202)
|
||||
self.assertEqual(response.content, "")
|
||||
self.assertEqual(202, response.status_code)
|
||||
self.assertEqual("", response.content)
|
||||
|
||||
def test_associate_host(self):
|
||||
response = self._do_post('os-networks/1/action',
|
||||
'network-associate-host-req',
|
||||
{"host": "testHost"})
|
||||
self.assertEqual(response.status_code, 202)
|
||||
self.assertEqual(response.content, "")
|
||||
self.assertEqual(202, response.status_code)
|
||||
self.assertEqual("", response.content)
|
||||
|
@ -66,7 +66,7 @@ class PreserveEphemeralOnRebuildJsonTest(test_servers.ServersSampleBase):
|
||||
subs.update(self._get_regexes())
|
||||
self._verify_response(resp_tpl, subs, response, 202)
|
||||
else:
|
||||
self.assertEqual(response.status_code, 202)
|
||||
self.assertEqual(202, response.status_code)
|
||||
|
||||
def test_server_rebuild_preserve_ephemeral_true(self):
|
||||
self._test_server_rebuild_preserve_ephemeral(True)
|
||||
|
@ -61,8 +61,8 @@ class QuotaSetsSampleJsonTests(api_sample_base.ApiSampleTestBaseV3):
|
||||
def test_delete_quotas(self):
|
||||
# Get api sample to delete quota.
|
||||
response = self._do_delete('os-quota-sets/fake_tenant')
|
||||
self.assertEqual(response.status_code, 202)
|
||||
self.assertEqual(response.content, '')
|
||||
self.assertEqual(202, response.status_code)
|
||||
self.assertEqual('', response.content)
|
||||
|
||||
def test_update_quotas_force(self):
|
||||
# Get api sample to update quotas.
|
||||
@ -79,8 +79,8 @@ class QuotaSetsSampleJsonTests(api_sample_base.ApiSampleTestBaseV3):
|
||||
|
||||
def test_delete_quotas_for_user(self):
|
||||
response = self._do_delete('os-quota-sets/fake_tenant?user_id=1')
|
||||
self.assertEqual(response.status_code, 202)
|
||||
self.assertEqual(response.content, '')
|
||||
self.assertEqual(202, response.status_code)
|
||||
self.assertEqual('', response.content)
|
||||
|
||||
def test_update_quotas_for_user(self):
|
||||
# Get api sample to update quotas for user.
|
||||
|
Loading…
Reference in New Issue
Block a user