Merge pull request #2382 from thaJeztah/fix_platform_tests

Adjust `--platform` tests for changes in docker engine
This commit is contained in:
Joffrey F 2019-07-18 22:49:54 -07:00 committed by GitHub
commit 17c86429e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View File

@ -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()

View File

@ -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):