summaryrefslogtreecommitdiff
path: root/tests/unit/errors_test.py
Commit message (Collapse)AuthorAgeFilesLines
* Implement context management, lifecycle and unittests.Anca Iordache2020-02-051-10/+10
| | | | Signed-off-by: Anca Iordache <anca.iordache@docker.com>
* Regression 443 test: relax status-code checkSebastiaan van Stijn2019-01-091-0/+21
| | | | | | | | | | | This test was testing for a 500 status, but this status is actually a bug in the API (as it's due to an invalid request), and the API should actually return a 400 status. To make this test handle both situations, relax the test to accept either a 4xx or 5xx status. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* fixes create_api_error_from_http_exception()Constantine Peresypkin2017-12-181-1/+15
| | | | | | | | `create_api_error_from_http_exception()` is never tested in the original code and will fail miserably when fed with empty `HTTPError` object see fixes in requests for this behaviour: https://github.com/requests/requests/pull/3179 Signed-off-by: Constantine Peresypkin <pconstantine@gmail.com>
* client.containers.run returns None if none of json-file or journald logging ↵Artem Bolshakov2017-08-171-1/+33
| | | | | | drivers used Signed-off-by: Artem Bolshakov <either.free@gmail.com>
* Fix APIError status_code property for client/server errorsalex-dr2017-03-221-0/+65
| | | | | | | | | | | | | requests.Response objects evaluate as falsy when the status_code attribute is in the 400-500 range. Therefore we are assured that prior to this change, APIError would show `is_server_error() == False` when generated with a 500-level response and `is_client_error() == False` when generated with a 400-level response. This is not desirable. Added some seemingly dry (not DRY) unit tests to ensure nothing silly slips back in here. Signed-off-by: alex-dr <alex@datarobot.com>
* Add new user-focused APIBen Firshman2016-11-221-0/+22
See #1086 Signed-off-by: Ben Firshman <ben@firshman.co.uk>