aboutsummaryrefslogtreecommitdiffstats
path: root/moon_authz/tests/unit_python
diff options
context:
space:
mode:
authorThomas Duval <thomas.duval@orange.com>2018-01-03 14:13:11 +0100
committerThomas Duval <thomas.duval@orange.com>2018-01-03 14:13:11 +0100
commitd023803536f069b4a69cfeeb744e56dfcd54103b (patch)
tree73747e82b064bfa49bbfa10d8db28264c15a8217 /moon_authz/tests/unit_python
parent52d037e757ac2189978e1129f469929fe73a9b7f (diff)
Clean the code and fix some bugs
Change-Id: I3516d001cb0792ca6b01a40b9d9d13efc3ba30f9
Diffstat (limited to 'moon_authz/tests/unit_python')
-rw-r--r--moon_authz/tests/unit_python/mock_pods.py8
-rw-r--r--moon_authz/tests/unit_python/test_authz.py8
2 files changed, 8 insertions, 8 deletions
diff --git a/moon_authz/tests/unit_python/mock_pods.py b/moon_authz/tests/unit_python/mock_pods.py
index 7488f4f3..74801cd1 100644
--- a/moon_authz/tests/unit_python/mock_pods.py
+++ b/moon_authz/tests/unit_python/mock_pods.py
@@ -10,15 +10,15 @@ pdp_mock = {
"keystone_project_id": "a64beb1cc224474fb4badd43173e7101"
},
"pdp_id1": {
- "name": "...",
+ "name": "pdp_id1",
"security_pipeline": ["policy_id_1", "policy_id_2"],
"keystone_project_id": "keystone_project_id1",
"description": "...",
},
"pdp_id12": {
- "name": "...",
+ "name": "pdp_id2",
"security_pipeline": ["policy_id_1", "policy_id_2"],
- "keystone_project_id": "keystone_project_id1",
+ "keystone_project_id": "keystone_project_id2",
"description": "...",
}
}
@@ -100,7 +100,7 @@ subject_mock = {
"policy_id_2": {
"subject_id": {
"name": "subject_name",
- "keystone_id": "keystone_project_id1",
+ "keystone_id": "keystone_project_id2",
"description": "a description"
}
}
diff --git a/moon_authz/tests/unit_python/test_authz.py b/moon_authz/tests/unit_python/test_authz.py
index f98abebc..50493c9f 100644
--- a/moon_authz/tests/unit_python/test_authz.py
+++ b/moon_authz/tests/unit_python/test_authz.py
@@ -12,9 +12,9 @@ def get_json(data):
def test_authz_true(context):
import moon_authz.server
- from python_moonutilities.security_functions import Context
+ from python_moonutilities.context import Context
from python_moonutilities.cache import Cache
- server = moon_authz.server.main()
+ server = moon_authz.server.create_server()
client = server.app.test_client()
CACHE = Cache()
CACHE.update()
@@ -33,9 +33,9 @@ def test_authz_true(context):
def test_user_not_allowed(context):
import moon_authz.server
- from python_moonutilities.security_functions import Context
+ from python_moonutilities.context import Context
from python_moonutilities.cache import Cache
- server = moon_authz.server.main()
+ server = moon_authz.server.create_server()
client = server.app.test_client()
CACHE = Cache()
CACHE.update()