diff --git a/tests/integration/api_build_test.py b/tests/integration/api_build_test.py index 8bfc7960..4776f453 100644 --- a/tests/integration/api_build_test.py +++ b/tests/integration/api_build_test.py @@ -448,8 +448,10 @@ class BuildTest(BaseAPIIntegrationTest): for _ in stream: pass - assert excinfo.value.status_code == 400 - assert 'invalid platform' in excinfo.exconly() + # Some API versions incorrectly returns 500 status; assert 4xx or 5xx + assert excinfo.value.is_error() + assert 'unknown operating system' in excinfo.exconly() \ + or 'invalid platform' in excinfo.exconly() def test_build_out_of_context_dockerfile(self): base_dir = tempfile.mkdtemp() diff --git a/tests/integration/api_image_test.py b/tests/integration/api_image_test.py index 050e7f33..56a76924 100644 --- a/tests/integration/api_image_test.py +++ b/tests/integration/api_image_test.py @@ -69,8 +69,10 @@ class PullImageTest(BaseAPIIntegrationTest): with pytest.raises(docker.errors.APIError) as excinfo: self.client.pull('hello-world', platform='foobar') - assert excinfo.value.status_code == 500 - assert 'invalid platform' in excinfo.exconly() + # Some API versions incorrectly returns 500 status; assert 4xx or 5xx + assert excinfo.value.is_error() + assert 'unknown operating system' in excinfo.exconly() \ + or 'invalid platform' in excinfo.exconly() class CommitTest(BaseAPIIntegrationTest):