-
Notifications
You must be signed in to change notification settings - Fork 210
feat: Ensure service account file exists before initializing credentials #386
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -8,6 +8,14 @@ def test_push_service_without_credentials(): | |||||
| except errors.AuthenticationError: | ||||||
| pass | ||||||
|
|
||||||
| def test_push_service_with_incorrect_service_account_file(): | ||||||
| try: | ||||||
| # figure out why this goddamn test is not running | ||||||
|
Contributor
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. This looks like a leftover note. Could you remove it before merging? (FYI, the test does run —
Suggested change
Author
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. Done! Sorry about that. 😆 |
||||||
| fcm = FCMNotification(service_account_file='./foo.json', project_id=None, credentials=None) | ||||||
| fcm.notify() | ||||||
| assert False, "Should raise InvalidDataError without correct service account file path" | ||||||
| except errors.InvalidDataError: | ||||||
| pass | ||||||
|
|
||||||
| def test_push_service_directly_passed_credentials(push_service): | ||||||
| # We should infer the project ID/endpoint from credentials | ||||||
|
|
||||||
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.
{path}here refers to theos.pathmodule imported above, not the file path string. This will render as something like<module 'posixpath' from '...'>in the error message. It should be{self._service_account_file}.Uh oh!
There was an error while loading. Please reload this page.
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.
Thanks for the feedback. I've incorporated the change.