diff options
author | Joffrey F <joffrey@docker.com> | 2017-08-21 14:41:10 -0700 |
---|---|---|
committer | Joffrey F <joffrey@docker.com> | 2017-08-21 15:31:47 -0700 |
commit | 4df962ba5a889a234157bb63a64d0ce88d1e6046 (patch) | |
tree | 0995a47dff804fb400585bef25f8670e98261492 /tests | |
parent | 3df0653493d5f2ff5e17de8211a32aed8f4c1965 (diff) | |
download | docker-py-1717-attach-stream-false.tar.gz |
Always send attach request as streaming1717-attach-stream-false
Signed-off-by: Joffrey F <joffrey@docker.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/integration/api_container_test.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/tests/integration/api_container_test.py b/tests/integration/api_container_test.py index f8b474a..a972c1c 100644 --- a/tests/integration/api_container_test.py +++ b/tests/integration/api_container_test.py @@ -1092,20 +1092,28 @@ class AttachContainerTest(BaseAPIIntegrationTest): command = "printf '{0}'".format(line) container = self.client.create_container(BUSYBOX, command, detach=True, tty=False) - ident = container['Id'] - self.tmp_containers.append(ident) + self.tmp_containers.append(container) opts = {"stdout": 1, "stream": 1, "logs": 1} - pty_stdout = self.client.attach_socket(ident, opts) + pty_stdout = self.client.attach_socket(container, opts) self.addCleanup(pty_stdout.close) - self.client.start(ident) + self.client.start(container) next_size = next_frame_size(pty_stdout) self.assertEqual(next_size, len(line)) data = read_exactly(pty_stdout, next_size) self.assertEqual(data.decode('utf-8'), line) + def test_attach_no_stream(self): + container = self.client.create_container( + BUSYBOX, 'echo hello' + ) + self.tmp_containers.append(container) + self.client.start(container) + output = self.client.attach(container, stream=False, logs=True) + assert output == 'hello\n'.encode(encoding='ascii') + class PauseTest(BaseAPIIntegrationTest): def test_pause_unpause(self): |