diff options
author | Sebastiaan van Stijn <github@gone.nl> | 2019-01-09 00:35:03 +0100 |
---|---|---|
committer | Sebastiaan van Stijn <github@gone.nl> | 2019-01-09 21:23:11 +0100 |
commit | 219c52141e3cd15db3348c5420220f640323499f (patch) | |
tree | 73c187dc41fb7d133e8b5d7bc03f15034fb5ecdb /docker/errors.py | |
parent | 5455c04f75cac6bf05a9f076a1f02c3cf8498a2e (diff) | |
download | docker-py-219c52141e3cd15db3348c5420220f640323499f.tar.gz |
Regression 443 test: relax status-code check
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>
Diffstat (limited to 'docker/errors.py')
-rw-r--r-- | docker/errors.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/docker/errors.py b/docker/errors.py index 0253695..c340dcb 100644 --- a/docker/errors.py +++ b/docker/errors.py @@ -63,6 +63,9 @@ class APIError(requests.exceptions.HTTPError, DockerException): if self.response is not None: return self.response.status_code + def is_error(self): + return self.is_client_error() or self.is_server_error() + def is_client_error(self): if self.status_code is None: return False |