aboutsummaryrefslogtreecommitdiffstats
path: root/moonv4/tests/send_authz.py
diff options
context:
space:
mode:
authorasteroide <thomas.duval@orange.com>2017-10-04 09:04:38 +0200
committerasteroide <thomas.duval@orange.com>2017-10-04 09:04:38 +0200
commitf28f884b86ad6a01afb3ebe7959a86aed0701539 (patch)
tree5c2c50bef281274a1aa6f432071a20c03b3a9678 /moonv4/tests/send_authz.py
parente2099e074250dd2a2f556fbb78b3db8f77e2c553 (diff)
Update code to the latest working version: version 4.2
Change-Id: I25d222ce9c8f4af8755886b79852d99b6870d515
Diffstat (limited to 'moonv4/tests/send_authz.py')
-rw-r--r--moonv4/tests/send_authz.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/moonv4/tests/send_authz.py b/moonv4/tests/send_authz.py
index a6ad7339..c21c8bca 100644
--- a/moonv4/tests/send_authz.py
+++ b/moonv4/tests/send_authz.py
@@ -136,7 +136,9 @@ def _send(url, stress_test=False):
return {}
if not stress_test:
if res.status_code == 200:
- logger.info("\033[1m{}\033[m {}".format(url, res.status_code))
+ logger.warning("\033[1m{}\033[m \033[32mGrant\033[m".format(url))
+ elif res.status_code == 401:
+ logger.warning("\033[1m{}\033[m \033[31mDeny\033[m".format(url))
else:
logger.error("\033[1m{}\033[m {} {}".format(url, res.status_code, res.text))
try:
@@ -146,11 +148,11 @@ def _send(url, stress_test=False):
logger.error(res.text)
else:
if j.get("result"):
- logger.warning("{} \033[32m{}\033[m".format(url, j.get("result")))
+ # logger.warning("{} \033[32m{}\033[m".format(url, j.get("result")))
logger.debug("{}".format(j.get("error", "")))
current_request['result'] = "Grant"
else:
- logger.warning("{} \033[31m{}\033[m".format(url, "Deny"))
+ # logger.warning("{} \033[31m{}\033[m".format(url, "Deny"))
logger.debug("{}".format(j))
current_request['result'] = "Deny"
return current_request