Implement "no-update" test for trusts
Trusts explicitly do not implement "patch" or "put". We now explicitly test for a 405 (Method Not Allowed), as updates are outside of the Keystone API, in an isolated test. Change-Id: I9b84732506f85df7ad820e3d1f2a0e3408ed071b Partial-Bug: #1776504
This commit is contained in:
parent
3e948cfab4
commit
6e74c6eab3
|
@ -76,6 +76,30 @@ class TestTrustOperations(test_v3.RestfulTestCase):
|
|||
expected_status=http_client.BAD_REQUEST
|
||||
)
|
||||
|
||||
def test_trusts_do_not_implement_updates(self):
|
||||
with self.test_client() as c:
|
||||
# create a new trust
|
||||
token = self.get_scoped_token()
|
||||
ref = unit.new_trust_ref(
|
||||
trustor_user_id=self.user_id,
|
||||
trustee_user_id=self.trustee_user_id,
|
||||
project_id=self.project_id,
|
||||
role_ids=[self.role_id])
|
||||
r = c.post('/v3/OS-TRUST/trusts',
|
||||
json={'trust': ref},
|
||||
headers={'X-Auth-Token': token})
|
||||
trust_id = r.json['trust']['id']
|
||||
c.patch(
|
||||
'/v3/OS-TRUST/trusts/%(trust_id)s' % {'trust_id': trust_id},
|
||||
json={'trust': ref},
|
||||
headers={'X-Auth-Token': token},
|
||||
expected_status_code=http_client.METHOD_NOT_ALLOWED)
|
||||
c.put(
|
||||
'/v3/OS-TRUST/trusts/%(trust_id)s' % {'trust_id': trust_id},
|
||||
json={'trust': ref},
|
||||
headers={'X-Auth-Token': token},
|
||||
expected_status_code=http_client.METHOD_NOT_ALLOWED)
|
||||
|
||||
def test_trust_crud(self):
|
||||
# create a new trust
|
||||
ref = unit.new_trust_ref(
|
||||
|
|
Loading…
Reference in New Issue