Added application/json hotfix, updated version number of SDK#33
Conversation
|
Unit tests |
bandwidth/account/client_module.py
Outdated
| def _check_response(self, response): | ||
| if response.status_code >= 400: | ||
| if response.headers.get('content-type') == 'application/json': | ||
| if "application/json" in response.headers.get('content-type'): |
There was a problem hiding this comment.
don't you need to change _make_request in all these files?
There was a problem hiding this comment.
what about backup_init.py? not sure if that file's used
bandwidth/account/client_module.py
Outdated
| def _check_response(self, response): | ||
| if response.status_code >= 400: | ||
| if response.headers.get('content-type') == 'application/json': | ||
| if "application/json" in response.headers.get('content-type'): |
There was a problem hiding this comment.
I would prefer to see a startsWith()
There was a problem hiding this comment.
Though what you have will likely work correctly in any conceivable case
There was a problem hiding this comment.
How about a try/catch without checking the content type. We’re either returning json or not, if the json parser works then we’re good. Catch any error and return some more context
|
Won't merge |
|
Reopening this PR for DX-5 |
|
Can I get a re-review from @jpinnix-bandwidth and @jmulford-bandwidth (informal for jmulford, since it's his PR he can't review it) |
|
@Aubron can you fix the unit tests? |
|
Looks like the starts with syntax is https://www.tutorialspoint.com/python/string_startswith.htm Also looks like there needs to be a I can show you how that's done |
I hate you too, python
when did that change back
Make sure you've checked off all these things before submitting: