mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-26 01:04:00 -04:00
Some unit test cleanup.
Signed-off-by: Cliff Hill <clifford.hill@gsa.gov>
This commit is contained in:
@@ -64,10 +64,10 @@ def _get_access_token(code, state):
|
|||||||
response_json = response.json()
|
response_json = response.json()
|
||||||
try:
|
try:
|
||||||
encoded_id_token = response_json["id_token"]
|
encoded_id_token = response_json["id_token"]
|
||||||
except KeyError as e:
|
except KeyError as e: # pragma: no cover
|
||||||
# Capture the response json here so it hopefully shows up in error reports
|
# Capture the response json here so it hopefully shows up in error reports
|
||||||
current_app.logger.error(
|
current_app.logger.error(
|
||||||
f"Error when getting id token {response_json} #notify-admin-1505"
|
f"Error when getting id token {response_json}"
|
||||||
)
|
)
|
||||||
raise KeyError(f"'access_token' {response.json()}") from e
|
raise KeyError(f"'access_token' {response.json()}") from e
|
||||||
id_token = jwt.decode(encoded_id_token, keystring, algorithms=["RS256"])
|
id_token = jwt.decode(encoded_id_token, keystring, algorithms=["RS256"])
|
||||||
@@ -81,7 +81,7 @@ def _get_access_token(code, state):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
access_token = response_json["access_token"]
|
access_token = response_json["access_token"]
|
||||||
except KeyError as e:
|
except KeyError as e: # pragma: no cover
|
||||||
# Capture the response json here so it hopefully shows up in error reports
|
# Capture the response json here so it hopefully shows up in error reports
|
||||||
current_app.logger.error(
|
current_app.logger.error(
|
||||||
f"Error when getting access token {response.json()} #notify-admin-1505"
|
f"Error when getting access token {response.json()} #notify-admin-1505"
|
||||||
|
|||||||
Reference in New Issue
Block a user