-
Notifications
You must be signed in to change notification settings - Fork 11
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
Add more type hints, fix some pylint warnings #71
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,12 +51,21 @@ ipdb = "^0.13.7" | |
extension-pkg-whitelist = [ | ||
"_socket", | ||
] | ||
ignore = ["google"] | ||
KapJI marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
[tool.pylint.basic] | ||
good-names = [ | ||
"zc", | ||
] | ||
Comment on lines
+57
to
+59
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is that for? 🤔 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To fix |
||
|
||
[tool.pylint.format] | ||
max-line-length = 88 | ||
min-similarity-lines = 7 | ||
|
||
[tool.pylint.messages_control] | ||
# Reasons disabled: | ||
# too-many-* - are not enforced for the sake of readability | ||
# too-few-* - same as too-many-* | ||
disable = [ | ||
"too-few-public-methods", | ||
"too-many-arguments", | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -70,7 +70,7 @@ def test_initialization(self): | |||||
self.assertIsNone(client.access_token_date) | ||||||
self.assertIsNone(client.homegraph_date) | ||||||
|
||||||
self.assertIsAASET(client.master_token) | ||||||
self.assertIsAasEt(client.master_token) | ||||||
|
||||||
@patch("glocaltokens.client.LOGGER.error") | ||||||
def test_initialization__valid(self, m_log): | ||||||
|
@@ -235,6 +235,7 @@ def test_get_access_token(self, m_perform_oauth, m_get_master_token, m_log): | |||||
self.assertEqual(m_perform_oauth.call_count, 0) | ||||||
|
||||||
# Another request with expired token must return new token (new request) | ||||||
assert self.client.access_token_date is not None | ||||||
self.client.access_token_date = self.client.access_token_date - timedelta( | ||||||
ACCESS_TOKEN_DURATION + 1 | ||||||
) | ||||||
|
@@ -250,7 +251,7 @@ def test_get_access_token(self, m_perform_oauth, m_get_master_token, m_log): | |||||
@patch("glocaltokens.client.GLocalAuthenticationTokens.get_access_token") | ||||||
def test_get_homegraph( | ||||||
self, | ||||||
m_get_access_token, # pylint: disable=unused-argument | ||||||
_m_get_access_token, | ||||||
KapJI marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
m_get_home_graph_request, | ||||||
m_structure_service_stub, | ||||||
m_secure_channel, | ||||||
|
@@ -279,6 +280,7 @@ def test_get_homegraph( | |||||
self.assertEqual(m_get_home_graph_request.call_count, 1) | ||||||
|
||||||
# Expired homegraph | ||||||
assert self.client.homegraph_date is not None | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's have here
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately, |
||||||
self.client.homegraph_date = self.client.homegraph_date - timedelta( | ||||||
HOMEGRAPH_DURATION + 1 | ||||||
) | ||||||
|
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.
I'm wondering if we should extract that check into a helper function decorator or just a helper function to call at all places as we do now