-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix mypy type checking errors #10
Conversation
To fix mypy type check errors.
@@ -593,12 +594,14 @@ def create_bearer_token( | |||
# Maybe we should use something custom instead. | |||
iss=provider_name, | |||
) | |||
return jwt.encode(payload, self.bearer_token_signing_secret, algorithm="HS256") | |||
return jwt.encode( | |||
payload, cast(str, self.bearer_token_signing_secret), algorithm="HS256" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This cast has been introduced in upstream as well.
@@ -469,10 +476,6 @@ def remote_refresh_token(self, token: str) -> (str, int): | |||
# Do nothing if authentication fails, e.g. token expired. | |||
return INVALID_EKIRJASTO_TOKEN, None | |||
elif response.status_code != 200: | |||
msg = "Got unexpected response code %d. Content: %s" % ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this msg
is not referenced anywhere
@@ -311,19 +311,12 @@ def test_secrets( | |||
): | |||
provider = create_provider() | |||
|
|||
# Secrets are not set, so this will fail. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The case of secrets not being set are also covered by the other test cases, so removed from here to fix mypy errors.
6ce474b
to
f47fdd4
Compare
83cdc06
to
12005a6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good 👍
Description
https://jira.lingsoft.fi/browse/SIMPLYE-202 - Enable Mypy type checks for ekirjasto-circulation in Github