diff options
author | Joffrey F <joffrey@docker.com> | 2017-01-25 16:31:43 -0800 |
---|---|---|
committer | Joffrey F <joffrey@docker.com> | 2017-01-25 16:52:26 -0800 |
commit | a1d550a14c188dd9ce30d6344e35c5e48ad8f75d (patch) | |
tree | 60a433e24cbd7a92cac8d2074c7d621560c8aea2 /tests/integration/models_images_test.py | |
parent | 4ff77dc1c910e07117c925cf0f9784529f3bd8d5 (diff) | |
download | docker-py-config_test_api_version.tar.gz |
Allow configuring API version for integration test with env varconfig_test_api_version
Signed-off-by: Joffrey F <joffrey@docker.com>
Diffstat (limited to 'tests/integration/models_images_test.py')
-rw-r--r-- | tests/integration/models_images_test.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/integration/models_images_test.py b/tests/integration/models_images_test.py index 876ec29..4f8bb26 100644 --- a/tests/integration/models_images_test.py +++ b/tests/integration/models_images_test.py @@ -3,13 +3,13 @@ import io import docker import pytest -from .base import BaseIntegrationTest +from .base import BaseIntegrationTest, TEST_API_VERSION class ImageCollectionTest(BaseIntegrationTest): def test_build(self): - client = docker.from_env() + client = docker.from_env(version=TEST_API_VERSION) image = client.images.build(fileobj=io.BytesIO( "FROM alpine\n" "CMD echo hello world".encode('ascii') @@ -19,7 +19,7 @@ class ImageCollectionTest(BaseIntegrationTest): @pytest.mark.xfail(reason='Engine 1.13 responds with status 500') def test_build_with_error(self): - client = docker.from_env() + client = docker.from_env(version=TEST_API_VERSION) with self.assertRaises(docker.errors.BuildError) as cm: client.images.build(fileobj=io.BytesIO( "FROM alpine\n" @@ -29,18 +29,18 @@ class ImageCollectionTest(BaseIntegrationTest): "NOTADOCKERFILECOMMAND") def test_list(self): - client = docker.from_env() + client = docker.from_env(version=TEST_API_VERSION) image = client.images.pull('alpine:latest') assert image.id in get_ids(client.images.list()) def test_list_with_repository(self): - client = docker.from_env() + client = docker.from_env(version=TEST_API_VERSION) image = client.images.pull('alpine:latest') assert image.id in get_ids(client.images.list('alpine')) assert image.id in get_ids(client.images.list('alpine:latest')) def test_pull(self): - client = docker.from_env() + client = docker.from_env(version=TEST_API_VERSION) image = client.images.pull('alpine:latest') assert 'alpine:latest' in image.attrs['RepoTags'] @@ -52,7 +52,7 @@ class ImageTest(BaseIntegrationTest): tag = 'some-tag' identifier = '{}:{}'.format(repo, tag) - client = docker.from_env() + client = docker.from_env(version=TEST_API_VERSION) image = client.images.pull('alpine:latest') image.tag(repo, tag) |