aboutsummaryrefslogtreecommitdiffstats
path: root/moonv4/moon_interface/tests/apitests/set_authz.py
diff options
context:
space:
mode:
Diffstat (limited to 'moonv4/moon_interface/tests/apitests/set_authz.py')
-rw-r--r--moonv4/moon_interface/tests/apitests/set_authz.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/moonv4/moon_interface/tests/apitests/set_authz.py b/moonv4/moon_interface/tests/apitests/set_authz.py
index 7d0d5069..38b63509 100644
--- a/moonv4/moon_interface/tests/apitests/set_authz.py
+++ b/moonv4/moon_interface/tests/apitests/set_authz.py
@@ -40,4 +40,11 @@ if not keystone_project_id:
for rule in rules:
url = "http://172.18.0.11:38001/authz/{}/{}".format(keystone_project_id, "/".join(rule))
req = requests.get(url)
- print(url, req.status_code)
+ print("\033[1m{}\033[m {}".format(url, req.status_code))
+ j = req.json()
+ # print(j)
+ if j.get("authz"):
+ print("\t\033[32m{}\033[m {}".format(j.get("authz"), j.get("error", "")))
+ else:
+ print("\t\033[31m{}\033[m {}".format(j.get("authz"), j.get("error", "")))
+