Switch to post-versioning
This combines 2 commits in order to pass the gate.
No longer mention next version on setup.cfg on stable branch.
Remove oslo.policy implementation tests from keystone
oslo.policy 0.12.0 contains a change to use requests to do the http
check rather than urllib. This change caused keystone tests to fail
because the keystone tests were mocking urllib, making assumptions
about how oslo.policy is implemented. Keystone doesn't need to test
internal features of oslo.policy, so these tests are removed.
Closes-Bug: 1505374
(cherry picked from commit 6016d01700
)
Change-Id: I75c44e88eb851a3b92a6d7d379d9a55e417703d6
This commit is contained in:
parent
8dcd82fb9c
commit
2d198d7fe0
@ -16,10 +16,8 @@
|
|||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
|
|
||||||
import mock
|
|
||||||
from oslo_policy import policy as common_policy
|
from oslo_policy import policy as common_policy
|
||||||
import six
|
import six
|
||||||
from six.moves.urllib import request as urlrequest
|
|
||||||
from testtools import matchers
|
from testtools import matchers
|
||||||
|
|
||||||
from keystone import exception
|
from keystone import exception
|
||||||
@ -118,28 +116,6 @@ class PolicyTestCase(BasePolicyTestCase):
|
|||||||
action = "example:allowed"
|
action = "example:allowed"
|
||||||
rules.enforce(self.credentials, action, self.target)
|
rules.enforce(self.credentials, action, self.target)
|
||||||
|
|
||||||
def test_enforce_http_true(self):
|
|
||||||
|
|
||||||
def fakeurlopen(url, post_data):
|
|
||||||
return six.StringIO("True")
|
|
||||||
|
|
||||||
action = "example:get_http"
|
|
||||||
target = {}
|
|
||||||
with mock.patch.object(urlrequest, 'urlopen', fakeurlopen):
|
|
||||||
result = rules.enforce(self.credentials, action, target)
|
|
||||||
self.assertTrue(result)
|
|
||||||
|
|
||||||
def test_enforce_http_false(self):
|
|
||||||
|
|
||||||
def fakeurlopen(url, post_data):
|
|
||||||
return six.StringIO("False")
|
|
||||||
|
|
||||||
action = "example:get_http"
|
|
||||||
target = {}
|
|
||||||
with mock.patch.object(urlrequest, 'urlopen', fakeurlopen):
|
|
||||||
self.assertRaises(exception.ForbiddenAction, rules.enforce,
|
|
||||||
self.credentials, action, target)
|
|
||||||
|
|
||||||
def test_templatized_enforcement(self):
|
def test_templatized_enforcement(self):
|
||||||
target_mine = {'project_id': 'fake'}
|
target_mine = {'project_id': 'fake'}
|
||||||
target_not_mine = {'project_id': 'another'}
|
target_not_mine = {'project_id': 'another'}
|
||||||
|
Loading…
Reference in New Issue
Block a user