-
-
Notifications
You must be signed in to change notification settings - Fork 65
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
Refactors test_routes as a separate module #266
Merged
aaron-junot
merged 12 commits into
OperationCode:master
from
Digbigpig:246-test_routes_module
Jan 10, 2020
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
b19e76c
Refactors test_routes as a separate module
Digbigpig c8caab0
Improve tests
aaron-junot 0d64796
Change invalid-credentials to unauthorized to match the standards of …
aaron-junot edd3af0
Improve tests some more
aaron-junot 17dfb04
Break test_get_resources into two functions
aaron-junot 3a20cef
Break test_update_votes into 3 functions
aaron-junot 9ab7a3b
Tests updated_after filter
Digbigpig db97b97
Moves validation test to test_resource_create.py
Digbigpig 3c8b74f
Use assert_correct_validation_error
aaron-junot 5ad3740
Fix lint
aaron-junot c7bf889
Remove debug print statements
aaron-junot 28a48b8
Improve tests
aaron-junot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -120,7 +120,7 @@ def standardize_response(payload={}, status_code=200, version=LATEST_API_VERSION | |
elif not data: | ||
# 500 Error case -- Something went wrong. | ||
message = msg_map.get(500) | ||
resp["errors"] = {'errors': {"server-error": {"message": message}}} | ||
resp["errors"] = {"server-error": {"message": message}} | ||
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. Fixing these tests to use a standardized utility function to check the responses was really good, because it caught this issue. A frontend would not have been able to parse correctly |
||
resp["status_code"] = 500 | ||
resp["status"] = err_map.get(500) | ||
else: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,3 @@ prometheus_client==0.7.1 | |
uWSGI==2.0.18 | ||
py-healthcheck==1.9.0 | ||
bandit==1.5.1 | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 only status code that returns an "invalid-*" response is a 422. For all the rest of the routes, the error is the same as the status, which in the case of 401 is "Unauthorized". I feel this API change is necessary for consistency