diff options
author | asteroide <thomas.duval@orange.com> | 2015-12-02 09:49:33 +0100 |
---|---|---|
committer | asteroide <thomas.duval@orange.com> | 2015-12-02 10:25:15 +0100 |
commit | 7a5a0e4df646d46476ec7a9fcdedd638e8781f6e (patch) | |
tree | 54eecd1210e4fb5db2b14edeac1df601da7698e2 /keystone-moon/keystone/tests/unit/test_v3_endpoint_policy.py | |
parent | 8d7b0ffa8e7a7bb09686d8f25176c364d5b6aa0e (diff) |
Update keystone to the branch stable/liberty.
Change-Id: I7cce62ae4b4cbca525a7b9499285455bdd04993e
Diffstat (limited to 'keystone-moon/keystone/tests/unit/test_v3_endpoint_policy.py')
-rw-r--r-- | keystone-moon/keystone/tests/unit/test_v3_endpoint_policy.py | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/keystone-moon/keystone/tests/unit/test_v3_endpoint_policy.py b/keystone-moon/keystone/tests/unit/test_v3_endpoint_policy.py index b0c8256e..3423d2d8 100644 --- a/keystone-moon/keystone/tests/unit/test_v3_endpoint_policy.py +++ b/keystone-moon/keystone/tests/unit/test_v3_endpoint_policy.py @@ -53,14 +53,12 @@ class EndpointPolicyTestCase(test_v3.RestfulTestCase): url, expected_status=http_client.NOT_FOUND) - self.put(url) + self.put(url, expected_status=204) # test that the new resource is accessible. - self.assert_head_and_get_return_same_response( - url, - expected_status=http_client.NO_CONTENT) + self.assert_head_and_get_return_same_response(url, expected_status=204) - self.delete(url) + self.delete(url, expected_status=204) # test that the deleted resource is no longer accessible self.assert_head_and_get_return_same_response( @@ -101,16 +99,18 @@ class EndpointPolicyTestCase(test_v3.RestfulTestCase): self.put('/policies/%(policy_id)s/OS-ENDPOINT-POLICY' '/endpoints/%(endpoint_id)s' % { 'policy_id': self.policy['id'], - 'endpoint_id': self.endpoint['id']}) + 'endpoint_id': self.endpoint['id']}, + expected_status=204) self.head('/endpoints/%(endpoint_id)s/OS-ENDPOINT-POLICY' '/policy' % { 'endpoint_id': self.endpoint['id']}, - expected_status=http_client.OK) + expected_status=200) r = self.get('/endpoints/%(endpoint_id)s/OS-ENDPOINT-POLICY' '/policy' % { - 'endpoint_id': self.endpoint['id']}) + 'endpoint_id': self.endpoint['id']}, + expected_status=200) self.assertValidPolicyResponse(r, ref=self.policy) def test_list_endpoints_for_policy(self): @@ -119,11 +119,13 @@ class EndpointPolicyTestCase(test_v3.RestfulTestCase): self.put('/policies/%(policy_id)s/OS-ENDPOINT-POLICY' '/endpoints/%(endpoint_id)s' % { 'policy_id': self.policy['id'], - 'endpoint_id': self.endpoint['id']}) + 'endpoint_id': self.endpoint['id']}, + expected_status=204) r = self.get('/policies/%(policy_id)s/OS-ENDPOINT-POLICY' '/endpoints' % { - 'policy_id': self.policy['id']}) + 'policy_id': self.policy['id']}, + expected_status=200) self.assertValidEndpointListResponse(r, ref=self.endpoint) self.assertThat(r.result.get('endpoints'), matchers.HasLength(1)) @@ -133,8 +135,8 @@ class EndpointPolicyTestCase(test_v3.RestfulTestCase): 'policy_id': self.policy['id'], 'endpoint_id': self.endpoint['id']} - self.put(url) - self.head(url) + self.put(url, expected_status=204) + self.head(url, expected_status=204) self.delete('/endpoints/%(endpoint_id)s' % { 'endpoint_id': self.endpoint['id']}) @@ -148,8 +150,8 @@ class EndpointPolicyTestCase(test_v3.RestfulTestCase): 'service_id': self.service['id'], 'region_id': self.region['id']} - self.put(url) - self.head(url) + self.put(url, expected_status=204) + self.head(url, expected_status=204) self.delete('/regions/%(region_id)s' % { 'region_id': self.region['id']}) @@ -163,8 +165,8 @@ class EndpointPolicyTestCase(test_v3.RestfulTestCase): 'service_id': self.service['id'], 'region_id': self.region['id']} - self.put(url) - self.head(url) + self.put(url, expected_status=204) + self.head(url, expected_status=204) self.delete('/services/%(service_id)s' % { 'service_id': self.service['id']}) @@ -177,8 +179,8 @@ class EndpointPolicyTestCase(test_v3.RestfulTestCase): 'policy_id': self.policy['id'], 'service_id': self.service['id']} - self.put(url) - self.get(url, expected_status=http_client.NO_CONTENT) + self.put(url, expected_status=204) + self.get(url, expected_status=204) self.delete('/policies/%(policy_id)s' % { 'policy_id': self.policy['id']}) @@ -191,8 +193,8 @@ class EndpointPolicyTestCase(test_v3.RestfulTestCase): 'policy_id': self.policy['id'], 'service_id': self.service['id']} - self.put(url) - self.get(url, expected_status=http_client.NO_CONTENT) + self.put(url, expected_status=204) + self.get(url, expected_status=204) self.delete('/services/%(service_id)s' % { 'service_id': self.service['id']}) |