Add send_authz in tests directory 63/42663/1
authorasteroide <thomas.duval@orange.com>
Thu, 21 Sep 2017 15:02:48 +0000 (17:02 +0200)
committerasteroide <thomas.duval@orange.com>
Thu, 21 Sep 2017 15:02:48 +0000 (17:02 +0200)
Change-Id: I4d1a508716daf41ab5dd0b02326ca6c351b9fa26

moonv4/tests/send_authz.py

index 305ecff..eae4e6c 100644 (file)
@@ -140,12 +140,14 @@ def _send(url, stress_test=False):
     except requests.exceptions.ConnectionError:
         logger.warning("Unable to connect to server")
         return {}
-    if res and not stress_test:
+    if not stress_test:
         logger.debug(res.status_code)
         logger.debug(res.text)
         if res.status_code == 200:
             # logger.warning("error code 200 for {}".format(self.url))
             logger.info("\033[1m{}\033[m {}".format(url, res.status_code))
+        else:
+            logger.error("\033[1m{}\033[m {} {}".format(url, res.status_code, res.text))
         try:
             j = res.json()
         except Exception as e: