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/base.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/base.py')
-rw-r--r-- | tests/integration/base.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/integration/base.py b/tests/integration/base.py index 4a41e6b..f0f5a91 100644 --- a/tests/integration/base.py +++ b/tests/integration/base.py @@ -1,3 +1,4 @@ +import os import shutil import unittest @@ -8,6 +9,7 @@ import six from .. import helpers BUSYBOX = 'busybox:buildroot-2014.02' +TEST_API_VERSION = os.environ.get('DOCKER_TEST_API_VERSION') class BaseIntegrationTest(unittest.TestCase): @@ -27,7 +29,7 @@ class BaseIntegrationTest(unittest.TestCase): self.tmp_networks = [] def tearDown(self): - client = docker.from_env() + client = docker.from_env(version=TEST_API_VERSION) for img in self.tmp_imgs: try: client.api.remove_image(img) @@ -61,7 +63,9 @@ class BaseAPIIntegrationTest(BaseIntegrationTest): def setUp(self): super(BaseAPIIntegrationTest, self).setUp() - self.client = docker.APIClient(timeout=60, **kwargs_from_env()) + self.client = docker.APIClient( + version=TEST_API_VERSION, timeout=60, **kwargs_from_env() + ) def run_container(self, *args, **kwargs): container = self.client.create_container(*args, **kwargs) |