From 655b92a2a4288407705f07ae7cd468ca5b14081f Mon Sep 17 00:00:00 2001 From: Bert Blommers Date: Sat, 20 Jun 2020 11:05:06 +0100 Subject: [PATCH] Simplify Cognito test - auto decode JSON --- tests/test_cognitoidp/test_cognitoidp.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/test_cognitoidp/test_cognitoidp.py b/tests/test_cognitoidp/test_cognitoidp.py index aefa573ef..5eb529e28 100644 --- a/tests/test_cognitoidp/test_cognitoidp.py +++ b/tests/test_cognitoidp/test_cognitoidp.py @@ -1379,6 +1379,5 @@ def fetch_public_keys(): keys_url = "https://cognito-idp.{}.amazonaws.com/{}/.well-known/jwks.json".format( "us-west-2", "someuserpoolid" ) - response = requests.get(keys_url).text - my_keys = json.loads(response.decode("utf-8"))["keys"] - return my_keys + response = requests.get(keys_url).json() + return response["keys"]