From f094ab49de601713432ec620a9e53d281c7ecd2f Mon Sep 17 00:00:00 2001 From: shockrah Date: Mon, 3 May 2021 13:24:24 -0700 Subject: [PATCH] * Adding some safey into the mock-client tester so that it doesn't just explode in pipelines --- json-api/client-tests/main.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/json-api/client-tests/main.py b/json-api/client-tests/main.py index 63f7a8d..8002455 100644 --- a/json-api/client-tests/main.py +++ b/json-api/client-tests/main.py @@ -16,8 +16,11 @@ def login() -> (Request, str): 200 ) response = req.fire() - jwt = response.json().get('jwt') - return (req, jwt) + try: + jwt = response.json().get('jwt') + return (req, jwt) + except: + return (req, None) def make_channel(url: str, id: int, jwt: str) -> (Request, int): # making a text channel @@ -89,6 +92,7 @@ if __name__ == '__main__': login_req, jwt = login() if jwt is None: print('Unable to /login - stopping now to avoid pointless failure') + req.show_response() exit(1) admin.jwt = jwt