Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: upgrade websocket-client to latest #3022

Merged
merged 2 commits into from
Jul 29, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ paramiko==2.11.0
pywin32==304; sys_platform == 'win32'
requests==2.28.1
urllib3==1.26.11
websocket-client==0.56.0
websocket-client==1.3.3
19 changes: 18 additions & 1 deletion tests/integration/api_container_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1197,7 +1197,7 @@ def test_run_container_streaming(self):
sock = self.client.attach_socket(container, ws=False)
assert sock.fileno() > -1

def test_run_container_reading_socket(self):
def test_run_container_reading_socket_http(self):
line = 'hi there and stuff and things, words!'
# `echo` appends CRLF, `printf` doesn't
command = f"printf '{line}'"
Expand All @@ -1217,6 +1217,23 @@ def test_run_container_reading_socket(self):
data = read_exactly(pty_stdout, next_size)
assert data.decode('utf-8') == line

def test_run_container_reading_socket_ws(self):
line = 'hi there and stuff and things, words!'
# `echo` appends CRLF, `printf` doesn't
command = f"printf '{line}'"
container = self.client.create_container(TEST_IMG, command,
detach=True, tty=False)
self.tmp_containers.append(container)

opts = {"stdout": 1, "stream": 1, "logs": 1}
pty_stdout = self.client.attach_socket(container, opts, ws=True)
self.addCleanup(pty_stdout.close)

self.client.start(container)

data = pty_stdout.recv()
assert data.decode('utf-8') == line

@pytest.mark.timeout(10)
def test_attach_no_stream(self):
container = self.client.create_container(
Expand Down