summaryrefslogtreecommitdiff
path: root/tests/integration/api_service_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/integration/api_service_test.py')
-rw-r--r--tests/integration/api_service_test.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/integration/api_service_test.py b/tests/integration/api_service_test.py
index 54111a7..c966916 100644
--- a/tests/integration/api_service_test.py
+++ b/tests/integration/api_service_test.py
@@ -376,6 +376,23 @@ class ServiceTest(BaseAPIIntegrationTest):
assert 'TTY' in con_spec
assert con_spec['TTY'] is True
+ @requires_api_version('1.25')
+ def test_create_service_with_tty_dict(self):
+ container_spec = {
+ 'Image': BUSYBOX,
+ 'Command': ['true'],
+ 'TTY': True
+ }
+ task_tmpl = docker.types.TaskTemplate(container_spec)
+ name = self.get_service_name()
+ svc_id = self.client.create_service(task_tmpl, name=name)
+ svc_info = self.client.inspect_service(svc_id)
+ assert 'TaskTemplate' in svc_info['Spec']
+ assert 'ContainerSpec' in svc_info['Spec']['TaskTemplate']
+ con_spec = svc_info['Spec']['TaskTemplate']['ContainerSpec']
+ assert 'TTY' in con_spec
+ assert con_spec['TTY'] is True
+
def test_create_service_global_mode(self):
container_spec = docker.types.ContainerSpec(
BUSYBOX, ['echo', 'hello']