Tests: prevented writing to the closed socket for websocket tests.

This commit is contained in:
Andrey Zelenkov
2019-08-30 16:59:35 +03:00
parent ccd6c0dc05
commit cb36616132

View File

@@ -180,7 +180,10 @@ class TestApplicationWebsocket(TestApplicationProto):
frame_len = len(frame) frame_len = len(frame)
while pos < frame_len: while pos < frame_len:
end = min(pos + chopsize, frame_len) end = min(pos + chopsize, frame_len)
sock.sendall(frame[pos:end]) try:
sock.sendall(frame[pos:end])
except BrokenPipeError:
end = frame_len
pos = end pos = end
def message(self, sock, type, message, fragmention_size=None, **kwargs): def message(self, sock, type, message, fragmention_size=None, **kwargs):