summaryrefslogtreecommitdiff
path: root/tests/integration/models_services_test.py
diff options
context:
space:
mode:
authorJoffrey F <joffrey@docker.com>2017-01-25 16:31:43 -0800
committerJoffrey F <joffrey@docker.com>2017-01-25 16:52:26 -0800
commita1d550a14c188dd9ce30d6344e35c5e48ad8f75d (patch)
tree60a433e24cbd7a92cac8d2074c7d621560c8aea2 /tests/integration/models_services_test.py
parent4ff77dc1c910e07117c925cf0f9784529f3bd8d5 (diff)
downloaddocker-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_services_test.py')
-rw-r--r--tests/integration/models_services_test.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/integration/models_services_test.py b/tests/integration/models_services_test.py
index 27979dd..9b5676d 100644
--- a/tests/integration/models_services_test.py
+++ b/tests/integration/models_services_test.py
@@ -4,21 +4,22 @@ import docker
import pytest
from .. import helpers
+from .base import TEST_API_VERSION
class ServiceTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
- client = docker.from_env()
+ client = docker.from_env(version=TEST_API_VERSION)
helpers.force_leave_swarm(client)
client.swarm.init('eth0', listen_addr=helpers.swarm_listen_addr())
@classmethod
def tearDownClass(cls):
- helpers.force_leave_swarm(docker.from_env())
+ helpers.force_leave_swarm(docker.from_env(version=TEST_API_VERSION))
def test_create(self):
- client = docker.from_env()
+ client = docker.from_env(version=TEST_API_VERSION)
name = helpers.random_name()
service = client.services.create(
# create arguments
@@ -36,7 +37,7 @@ class ServiceTest(unittest.TestCase):
assert container_spec['Labels'] == {'container': 'label'}
def test_get(self):
- client = docker.from_env()
+ client = docker.from_env(version=TEST_API_VERSION)
name = helpers.random_name()
service = client.services.create(
name=name,
@@ -47,7 +48,7 @@ class ServiceTest(unittest.TestCase):
assert service.name == name
def test_list_remove(self):
- client = docker.from_env()
+ client = docker.from_env(version=TEST_API_VERSION)
service = client.services.create(
name=helpers.random_name(),
image="alpine",
@@ -58,7 +59,7 @@ class ServiceTest(unittest.TestCase):
assert service not in client.services.list()
def test_tasks(self):
- client = docker.from_env()
+ client = docker.from_env(version=TEST_API_VERSION)
service1 = client.services.create(
name=helpers.random_name(),
image="alpine",
@@ -83,7 +84,7 @@ class ServiceTest(unittest.TestCase):
@pytest.mark.skip(reason="Makes Swarm unstable?")
def test_update(self):
- client = docker.from_env()
+ client = docker.from_env(version=TEST_API_VERSION)
service = client.services.create(
# create arguments
name=helpers.random_name(),