diff options
Diffstat (limited to 'tests/integration/api_container_test.py')
-rw-r--r-- | tests/integration/api_container_test.py | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/tests/integration/api_container_test.py b/tests/integration/api_container_test.py index ebb5e91..f48e78e 100644 --- a/tests/integration/api_container_test.py +++ b/tests/integration/api_container_test.py @@ -17,7 +17,7 @@ import six from .base import BUSYBOX, BaseAPIIntegrationTest from .. import helpers from ..helpers import ( - requires_api_version, ctrl_with, assert_socket_closed_with_keys + requires_api_version, ctrl_with, assert_cat_socket_detached_with_keys ) @@ -1227,55 +1227,54 @@ class AttachContainerTest(BaseAPIIntegrationTest): def test_detach_with_default(self): container = self.client.create_container( - BUSYBOX, '/bin/sh', + BUSYBOX, 'cat', detach=True, stdin_open=True, tty=True ) - id = container['Id'] - self.tmp_containers.append(id) - self.client.start(id) + self.tmp_containers.append(container) + self.client.start(container) sock = self.client.attach_socket( container, {'stdin': True, 'stream': True} ) - assert_socket_closed_with_keys(sock, [ctrl_with('p'), ctrl_with('q')]) + assert_cat_socket_detached_with_keys( + sock, [ctrl_with('p'), ctrl_with('q')] + ) def test_detach_with_config_file(self): self.client._general_configs['detachKeys'] = 'ctrl-p' container = self.client.create_container( - BUSYBOX, '/bin/sh', + BUSYBOX, 'cat', detach=True, stdin_open=True, tty=True ) - id = container['Id'] - self.tmp_containers.append(id) - self.client.start(id) + self.tmp_containers.append(container) + self.client.start(container) sock = self.client.attach_socket( container, {'stdin': True, 'stream': True} ) - assert_socket_closed_with_keys(sock, [ctrl_with('p')]) + assert_cat_socket_detached_with_keys(sock, [ctrl_with('p')]) def test_detach_with_arg(self): self.client._general_configs['detachKeys'] = 'ctrl-p' container = self.client.create_container( - BUSYBOX, '/bin/sh', + BUSYBOX, 'cat', detach=True, stdin_open=True, tty=True ) - id = container['Id'] - self.tmp_containers.append(id) - self.client.start(id) + self.tmp_containers.append(container) + self.client.start(container) sock = self.client.attach_socket( container, {'stdin': True, 'stream': True, 'detachKeys': 'ctrl-x'} ) - assert_socket_closed_with_keys(sock, [ctrl_with('x')]) + assert_cat_socket_detached_with_keys(sock, [ctrl_with('x')]) class PauseTest(BaseAPIIntegrationTest): |