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: I3d81fbc0a9634ae66df5dc61f14539074c18e492
This commit is contained in:
parent
858114bb6b
commit
2e03de6b0d
@ -44,16 +44,16 @@ class AdminActionsSamplesJsonTest(test_servers.ServersSampleBase):
|
||||
# Get api samples to reset server network request.
|
||||
response = self._do_post('servers/%s/action' % self.uuid,
|
||||
'admin-actions-reset-network', {})
|
||||
self.assertEqual(response.status_code, 202)
|
||||
self.assertEqual(202, response.status_code)
|
||||
|
||||
def test_post_inject_network_info(self):
|
||||
# Get api samples to inject network info request.
|
||||
response = self._do_post('servers/%s/action' % self.uuid,
|
||||
'admin-actions-inject-network-info', {})
|
||||
self.assertEqual(response.status_code, 202)
|
||||
self.assertEqual(202, response.status_code)
|
||||
|
||||
def test_post_reset_state(self):
|
||||
# get api samples to server reset state request.
|
||||
response = self._do_post('servers/%s/action' % self.uuid,
|
||||
'admin-actions-reset-server-state', {})
|
||||
self.assertEqual(response.status_code, 202)
|
||||
self.assertEqual(202, response.status_code)
|
||||
|
@ -31,5 +31,5 @@ class AdminPasswordJsonTest(test_servers.ServersSampleBase):
|
||||
response = self._do_post('servers/%s/action' % uuid,
|
||||
'admin-password-change-password',
|
||||
subs)
|
||||
self.assertEqual(response.status_code, 202)
|
||||
self.assertEqual(response.content, "")
|
||||
self.assertEqual(202, response.status_code)
|
||||
self.assertEqual("", response.content)
|
||||
|
@ -109,4 +109,4 @@ class AgentsJsonTest(api_sample_base.ApiSampleTestBaseV3):
|
||||
# Deletes an existing agent build.
|
||||
agent_id = 1
|
||||
response = self._do_delete('os-agents/%s' % agent_id)
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertEqual(200, response.status_code)
|
||||
|
@ -62,5 +62,5 @@ class AssistedVolumeSnapshotsJsonTests(test_servers.ServersSampleBase):
|
||||
'os-assisted-volume-snapshots/%s?delete_info='
|
||||
'{"volume_id":"521752a6-acf6-4b2d-bc7a-119f9148cd8c"}'
|
||||
% snapshot_id)
|
||||
self.assertEqual(response.status_code, 204)
|
||||
self.assertEqual(response.content, '')
|
||||
self.assertEqual(204, response.status_code)
|
||||
self.assertEqual('', response.content)
|
||||
|
@ -176,5 +176,5 @@ class AttachInterfacesSampleJsonTest(test_servers.ServersSampleBase):
|
||||
port_id = 'ce531f90-199f-48c0-816c-13e38010b442'
|
||||
response = self._do_delete('servers/%s/os-interface/%s' %
|
||||
(instance_uuid, port_id))
|
||||
self.assertEqual(response.status_code, 202)
|
||||
self.assertEqual(response.content, '')
|
||||
self.assertEqual(202, response.status_code)
|
||||
self.assertEqual('', response.content)
|
||||
|
@ -88,5 +88,5 @@ class CloudPipeSampleTest(api_sample_base.ApiSampleTestBaseV3):
|
||||
response = self._do_put('os-cloudpipe/configure-project',
|
||||
'cloud-pipe-update-req',
|
||||
subs)
|
||||
self.assertEqual(response.status_code, 202)
|
||||
self.assertEqual(response.content, "")
|
||||
self.assertEqual(202, response.status_code)
|
||||
self.assertEqual("", response.content)
|
||||
|
@ -53,4 +53,4 @@ class ConsolesSamplesJsonTest(test_servers.ServersSampleBase):
|
||||
uuid = self._post_server()
|
||||
self._create_consoles(uuid)
|
||||
response = self._do_delete('servers/%s/consoles/1' % uuid)
|
||||
self.assertEqual(response.status_code, 202)
|
||||
self.assertEqual(202, response.status_code)
|
||||
|
@ -43,8 +43,8 @@ class DeferredDeleteSampleJsonTests(test_servers.ServersSampleBase):
|
||||
|
||||
response = self._do_post('servers/%s/action' % uuid,
|
||||
'restore-post-req', {})
|
||||
self.assertEqual(response.status_code, 202)
|
||||
self.assertEqual(response.content, '')
|
||||
self.assertEqual(202, response.status_code)
|
||||
self.assertEqual('', response.content)
|
||||
|
||||
def test_force_delete(self):
|
||||
uuid = self._post_server()
|
||||
@ -52,5 +52,5 @@ class DeferredDeleteSampleJsonTests(test_servers.ServersSampleBase):
|
||||
|
||||
response = self._do_post('servers/%s/action' % uuid,
|
||||
'force-delete-post-req', {})
|
||||
self.assertEqual(response.status_code, 202)
|
||||
self.assertEqual(response.content, '')
|
||||
self.assertEqual(202, response.status_code)
|
||||
self.assertEqual('', response.content)
|
||||
|
@ -76,10 +76,10 @@ class DiskConfigJsonTest(test_servers.ServersSampleBase):
|
||||
uuid = self._post_server(use_common_server_api_samples=False)
|
||||
response = self._do_post('servers/%s/action' % uuid,
|
||||
'server-resize-post-req', {})
|
||||
self.assertEqual(response.status_code, 202)
|
||||
self.assertEqual(202, response.status_code)
|
||||
# NOTE(tmello): Resize does not return response body
|
||||
# Bug #1085213.
|
||||
self.assertEqual(response.content, "")
|
||||
self.assertEqual("", response.content)
|
||||
|
||||
def test_rebuild_server(self):
|
||||
uuid = self._post_server(use_common_server_api_samples=False)
|
||||
|
@ -98,8 +98,8 @@ class FixedIpTest(test_servers.ServersSampleBase):
|
||||
response = self._do_post('os-fixed-ips/192.168.1.1/action',
|
||||
'fixedip-post-req', {},
|
||||
api_version=self.request_api_version)
|
||||
self.assertEqual(response.status_code, 202)
|
||||
self.assertEqual(response.content, "")
|
||||
self.assertEqual(202, response.status_code)
|
||||
self.assertEqual("", response.content)
|
||||
|
||||
def _test_get_fixed_ip(self, **kwargs):
|
||||
# Return data about the given fixed ip.
|
||||
|
Loading…
Reference in New Issue
Block a user