-
-
Notifications
You must be signed in to change notification settings - Fork 41
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 crash for unknown resource, add Podcast & Episode resources #134
Fix crash for unknown resource, add Podcast & Episode resources #134
Conversation
- created a (so far empty) Podcast(Resource) class - import it in client.py and add it to Client.objects_types as "podcast" - update test cassette files (with the new podcast data) - updates existing tests (to check for the now-changed cassette data)
If a "type" is unknown, it instead instantiates the general class `Resource`
Not sure how to achieve 100% coverage on this - how would we test for an unexpected resource?(!) |
We could write a test specificly for the https://github.com/browniebroke/deezer-python/blob/master/tests/test_client.py If we write a test for If we do it at the |
I think |
Put them in the alphabetical order of the other resources
Also tests all types that yield a specific Resource class
Sourcery Code Quality Report (beta)Merging this PR leaves code quality unchanged.
Here are some functions in these files that still need a tune-up:
Please see our documentation here for details on how these metrics are calculated. We are actively working on this report - lots more documentation and extra metrics to come! Let us know what you think of it by mentioning @sourcery-ai in a comment. |
Thanks for the great work! 🎉 |
@all-contributors please add @hithomasmorelli for bug, code, ideas |
I've put up a pull request to add @hithomasmorelli! 🎉 |
Fixes #132
Have so far created an empty
Podcast
class and linked it intoClient
.Am planning to also take the opportunity to integrate some Podcast API functionality, and add a failsafe to
_process_json
to prevent a new "type" from causing a crash in the future (by just instantiating aResource
)(*a test for the failsafe would be a test that the program doesn't crash upon finding an unknown "type" field - not sure on the best way to implement this)