diff options
author | Brant Knudson <bknudson@us.ibm.com> | 2016-05-02 13:13:18 -0500 |
---|---|---|
committer | Steve Martinelli <s.martinelli@gmail.com> | 2016-05-10 19:01:45 +0000 |
commit | f3b9b41dccc6c2e74acaf6bc3dda14df34b4eb29 (patch) | |
tree | 768850b169d01aa2a9e988b0fd2d0d47c5cf3f41 | |
parent | 762b0c1783dd28cffd071b012aff1cf0faccec4e (diff) | |
download | keystone-f3b9b41dccc6c2e74acaf6bc3dda14df34b4eb29.tar.gz |
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
(cherry picked from commit 8eb7960e0f31c2624230b88d17933b3f48a17eaa)
-rw-r--r-- | keystone/tests/unit/test_policy.py | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/keystone/tests/unit/test_policy.py b/keystone/tests/unit/test_policy.py index 686e2b70d..0dbd85bf3 100644 --- a/keystone/tests/unit/test_policy.py +++ b/keystone/tests/unit/test_policy.py @@ -65,15 +65,6 @@ class PolicyFileTestCase(BasePolicyTestCase): 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(BasePolicyTestCase): def setUp(self): |