summaryrefslogtreecommitdiff
path: root/tests/integration/api_image_test.py
diff options
context:
space:
mode:
authorJoffrey F <joffrey@docker.com>2018-01-08 18:11:29 -0800
committerJoffrey F <joffrey@docker.com>2018-01-23 16:59:09 -0800
commitf95b958429b38dab50929e013db3c636a12e1536 (patch)
treeb8de1cfd18d1c3c932592388143665f446e871f6 /tests/integration/api_image_test.py
parentbf5e7702df3c835a5db4fc6b86500b4f4b659c14 (diff)
downloaddocker-py-1855-platform-option.tar.gz
Add support for experimental platform flag in build and pull1855-platform-option
Signed-off-by: Joffrey F <joffrey@docker.com>
Diffstat (limited to 'tests/integration/api_image_test.py')
-rw-r--r--tests/integration/api_image_test.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/integration/api_image_test.py b/tests/integration/api_image_test.py
index 14fb77a..178c34e 100644
--- a/tests/integration/api_image_test.py
+++ b/tests/integration/api_image_test.py
@@ -14,7 +14,7 @@ from six.moves import socketserver
import docker
-from ..helpers import requires_api_version
+from ..helpers import requires_api_version, requires_experimental
from .base import BaseAPIIntegrationTest, BUSYBOX
@@ -67,6 +67,15 @@ class PullImageTest(BaseAPIIntegrationTest):
img_info = self.client.inspect_image('hello-world')
self.assertIn('Id', img_info)
+ @requires_api_version('1.32')
+ @requires_experimental(until=None)
+ def test_pull_invalid_platform(self):
+ 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()
+
class CommitTest(BaseAPIIntegrationTest):
def test_commit(self):