at 16.09-beta 61 lines 2.2 kB view raw
1From 6016d017004acaae288312b196ef07ea98e9962d Mon Sep 17 00:00:00 2001 2From: Brant Knudson <bknudson@us.ibm.com> 3Date: Mon, 12 Oct 2015 15:12:45 -0500 4Subject: [PATCH] Remove oslo.policy implementation tests from keystone 5 6oslo.policy 0.12.0 contains a change to use requests to do the http 7check rather than urllib. This change caused keystone tests to fail 8because the keystone tests were mocking urllib, making assumptions 9about how oslo.policy is implemented. Keystone doesn't need to test 10internal features of oslo.policy, so these tests are removed. 11 12Change-Id: I9d6e4950b9fe75cbb94100c8effdcec002642027 13Closes-Bug: 1505374 14--- 15 keystone/tests/unit/test_policy.py | 24 ------------------------ 16 1 file changed, 24 deletions(-) 17 18diff --git a/keystone/tests/unit/test_policy.py b/keystone/tests/unit/test_policy.py 19index b2f0e52..686e2b7 100644 20--- a/keystone/tests/unit/test_policy.py 21+++ b/keystone/tests/unit/test_policy.py 22@@ -16,10 +16,8 @@ 23 import json 24 import os 25 26-import mock 27 from oslo_policy import policy as common_policy 28 import six 29-from six.moves.urllib import request as urlrequest 30 from testtools import matchers 31 32 from keystone import exception 33@@ -118,28 +116,6 @@ def test_enforce_good_action(self): 34 action = "example:allowed" 35 rules.enforce(self.credentials, action, self.target) 36 37- def test_enforce_http_true(self): 38- 39- def fakeurlopen(url, post_data): 40- return six.StringIO("True") 41- 42- action = "example:get_http" 43- target = {} 44- with mock.patch.object(urlrequest, 'urlopen', fakeurlopen): 45- result = rules.enforce(self.credentials, action, target) 46- self.assertTrue(result) 47- 48- def test_enforce_http_false(self): 49- 50- def fakeurlopen(url, post_data): 51- return six.StringIO("False") 52- 53- action = "example:get_http" 54- target = {} 55- with mock.patch.object(urlrequest, 'urlopen', fakeurlopen): 56- self.assertRaises(exception.ForbiddenAction, rules.enforce, 57- self.credentials, action, target) 58- 59 def test_templatized_enforcement(self): 60 target_mine = {'project_id': 'fake'} 61 target_not_mine = {'project_id': 'another'}