-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for PUT. Unit tests for error response for 100% coverage
- Loading branch information
1 parent
e0a2712
commit e574d4e
Showing
4 changed files
with
44 additions
and
0 deletions.
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from client.responses.error import ErrorResponse | ||
|
||
|
||
def test_error_response_init(): | ||
error = ErrorResponse('woops', 404) | ||
|
||
assert error.status_code == 404 | ||
assert error.errors == 'woops' | ||
assert error.text == None | ||
|
||
|
||
def test_error_response_json(): | ||
error = ErrorResponse('woops', 404) | ||
errorJson = error.json() | ||
|
||
assert errorJson == 'woops' | ||
|
||
|
||
def test_error_response_tostring(): | ||
error = ErrorResponse('woops', 404) | ||
|
||
assert error.__str__() == 'Status: 404, Errors: woops' |