summary refs log tree commit diff
path: root/pkgs/applications/virtualization/openstack/remove-oslo-policy-tests.patch
blob: 3cdc27a2d2af2e46998407f82fe48bcc213847fc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
From 6016d017004acaae288312b196ef07ea98e9962d Mon Sep 17 00:00:00 2001
From: Brant Knudson <bknudson@us.ibm.com>
Date: Mon, 12 Oct 2015 15:12:45 -0500
Subject: [PATCH] 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.

Change-Id: I9d6e4950b9fe75cbb94100c8effdcec002642027
Closes-Bug: 1505374
---
 keystone/tests/unit/test_policy.py | 24 ------------------------
 1 file changed, 24 deletions(-)

diff --git a/keystone/tests/unit/test_policy.py b/keystone/tests/unit/test_policy.py
index b2f0e52..686e2b7 100644
--- a/keystone/tests/unit/test_policy.py
+++ b/keystone/tests/unit/test_policy.py
@@ -16,10 +16,8 @@
 import json
 import os
 
-import mock
 from oslo_policy import policy as common_policy
 import six
-from six.moves.urllib import request as urlrequest
 from testtools import matchers
 
 from keystone import exception
@@ -118,28 +116,6 @@ def test_enforce_good_action(self):
         action = "example:allowed"
         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):
         target_mine = {'project_id': 'fake'}
         target_not_mine = {'project_id': 'another'}