diff options
Diffstat (limited to 'tests/integration/api_build_test.py')
-rw-r--r-- | tests/integration/api_build_test.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/integration/api_build_test.py b/tests/integration/api_build_test.py index 7cc3234..245214e 100644 --- a/tests/integration/api_build_test.py +++ b/tests/integration/api_build_test.py @@ -377,3 +377,18 @@ class BuildTest(BaseAPIIntegrationTest): def test_build_gzip_custom_encoding(self): with self.assertRaises(errors.DockerException): self.client.build(path='.', gzip=True, encoding='text/html') + + @requires_api_version('1.32') + @requires_experimental(until=None) + def test_build_invalid_platform(self): + script = io.BytesIO('FROM busybox\n'.encode('ascii')) + + with pytest.raises(errors.APIError) as excinfo: + stream = self.client.build( + fileobj=script, stream=True, platform='foobar' + ) + for _ in stream: + pass + + assert excinfo.value.status_code == 400 + assert 'invalid platform' in excinfo.exconly() |