Remove duplicated negative factors in keypair test
In test_keypair_create_fail_policy, there are two negative factors. One is a policy violation, and another is a bad request body. The purpose of the test is checking the policy violation, so a bad request body is not right for this test. This patch removes a bad request body from the test. Change-Id: Ia165e08410b0576950efe83e5ab6a92c9c7f6a50
This commit is contained in:
parent
3ab81c9b3e
commit
509ed96c6f
@ -373,6 +373,7 @@ class KeypairPolicyTest(test.TestCase):
|
||||
self.assertIn('keypair', res)
|
||||
|
||||
def test_keypair_create_fail_policy(self):
|
||||
body = {'keypair': {'name': 'create_test'}}
|
||||
rules = {'compute_extension:keypairs:create':
|
||||
common_policy.parse_rule('role:admin')}
|
||||
policy.set_rules(rules)
|
||||
@ -380,7 +381,7 @@ class KeypairPolicyTest(test.TestCase):
|
||||
req.method = 'POST'
|
||||
self.assertRaises(exception.Forbidden,
|
||||
self.KeyPairController.create,
|
||||
req, {})
|
||||
req, body)
|
||||
|
||||
def test_keypair_create_pass_policy(self):
|
||||
body = {'keypair': {'name': 'create_test'}}
|
||||
|
Loading…
Reference in New Issue
Block a user