diff options
author | Andrey Zelenkov <zelenkov@nginx.com> | 2019-09-02 18:03:33 +0300 |
---|---|---|
committer | Andrey Zelenkov <zelenkov@nginx.com> | 2019-09-02 18:03:33 +0300 |
commit | 1cfd329b3d2746e73432e8007d429e565c6b5fa0 (patch) | |
tree | c797f86b1b9cf358dc66f5c74dff78bf9b54bd1f | |
parent | 790b4f8f00285ba005816239cb242e953d60db69 (diff) | |
download | unit-1cfd329b3d2746e73432e8007d429e565c6b5fa0.tar.gz unit-1cfd329b3d2746e73432e8007d429e565c6b5fa0.tar.bz2 |
Tests: fixed recv_bytes() in websockets.py.
Diffstat (limited to '')
-rw-r--r-- | test/test_node_websockets.py | 2 | ||||
-rw-r--r-- | test/unit/applications/websockets.py | 12 |
2 files changed, 3 insertions, 11 deletions
diff --git a/test/test_node_websockets.py b/test/test_node_websockets.py index dcc4d7ca..86964ce0 100644 --- a/test/test_node_websockets.py +++ b/test/test_node_websockets.py @@ -386,7 +386,6 @@ class TestNodeWebsockets(TestApplicationNode): # validation for websocket frames. It should be implemented # by application, if necessary. - @unittest.skip('not yet') def test_node_websockets_1_1_1__1_1_8(self): self.load('websockets/mirror') @@ -413,7 +412,6 @@ class TestNodeWebsockets(TestApplicationNode): self.close_connection(sock) - @unittest.skip('not yet') def test_node_websockets_1_2_1__1_2_8(self): self.load('websockets/mirror') diff --git a/test/unit/applications/websockets.py b/test/unit/applications/websockets.py index 3553af6e..5f9c3c51 100644 --- a/test/unit/applications/websockets.py +++ b/test/unit/applications/websockets.py @@ -61,15 +61,9 @@ class TestApplicationWebsocket(TestApplicationProto): def recv_bytes(sock, bytes): data = b'' while select.select([sock], [], [], read_timeout)[0]: - try: - if bytes < 65536: - data = sock.recv(bytes) - else: - data = self.recvall( - sock, read_timeout=read_timeout, buff_size=bytes - ) - break - except: + data += sock.recv(bytes - len(data)) + + if len(data) == bytes: break return data |