Remove test_invalid_policy_raises_error
This test is validating internal behavior of the oslo.policy library. Since oslo.policy already has tests for this function, we don't have to test it in keystone. As of commit 83d209e in oslo.policy the test fails because oslo.policy has been enhanced to support YAML and the test is using valid YAML. An alternative is to change the test to have a file that's invalid YAML (remove the ']'), but then it might break again. An alternative is to change the test to mock out the behavior, but then the test would just be showing that if we mock out rules.enforce to raise ValueError it does that. Change-Id: I4ead61566000aedf62c9c48b0702ea30472c9925
This commit is contained in:
parent
61a135cf7d
commit
8eb7960e0f
|
@ -52,15 +52,6 @@ class PolicyFileTestCase(unit.TestCase):
|
|||
self.assertRaises(exception.ForbiddenAction, rules.enforce,
|
||||
empty_credentials, action, self.target)
|
||||
|
||||
def test_invalid_policy_raises_error(self):
|
||||
action = "example:test"
|
||||
empty_credentials = {}
|
||||
invalid_json = '{"example:test": [],}'
|
||||
with open(self.tmpfilename, "w") as policyfile:
|
||||
policyfile.write(invalid_json)
|
||||
self.assertRaises(ValueError, rules.enforce,
|
||||
empty_credentials, action, self.target)
|
||||
|
||||
|
||||
class PolicyTestCase(unit.TestCase):
|
||||
def setUp(self):
|
||||
|
|
Loading…
Reference in New Issue