summaryrefslogtreecommitdiffhomepage
path: root/test/test_node_websockets.py
diff options
context:
space:
mode:
authorAndrei Zeliankou <zelenkov@nginx.com>2020-04-14 02:35:04 +0100
committerAndrei Zeliankou <zelenkov@nginx.com>2020-04-14 02:35:04 +0100
commit0bfa09dfa0ec6a1474ba30d0e1f8aea832fbc1fc (patch)
tree99dd1db9a07c82aafd61b3afb03d12e65e0d399d /test/test_node_websockets.py
parent58cc13ab291cac5b13462006e3feb780178ef5f3 (diff)
downloadunit-0bfa09dfa0ec6a1474ba30d0e1f8aea832fbc1fc.tar.gz
unit-0bfa09dfa0ec6a1474ba30d0e1f8aea832fbc1fc.tar.bz2
Tests: minor fixes and style.
Diffstat (limited to 'test/test_node_websockets.py')
-rw-r--r--test/test_node_websockets.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/test/test_node_websockets.py b/test/test_node_websockets.py
index cb6bf137..4ce727db 100644
--- a/test/test_node_websockets.py
+++ b/test/test_node_websockets.py
@@ -26,7 +26,7 @@ class TestNodeWebsockets(TestApplicationNode):
)
def close_connection(self, sock):
- self.assertEqual(self.recvall(sock, read_timeout=1), b'', 'empty sock')
+ self.assertEqual(self.recvall(sock, read_timeout=0.1), b'', 'empty soc')
self.ws.frame_write(sock, self.ws.OP_CLOSE, self.ws.serialize_close())
@@ -460,12 +460,12 @@ class TestNodeWebsockets(TestApplicationNode):
_, sock, _ = self.ws.upgrade()
self.ws.frame_write(sock, self.ws.OP_PONG, '')
- self.assertEqual(self.recvall(sock, read_timeout=1), b'', '2_7')
+ self.assertEqual(self.recvall(sock, read_timeout=0.1), b'', '2_7')
# 2_8
self.ws.frame_write(sock, self.ws.OP_PONG, 'unsolicited pong payload')
- self.assertEqual(self.recvall(sock, read_timeout=1), b'', '2_8')
+ self.assertEqual(self.recvall(sock, read_timeout=0.1), b'', '2_8')
# 2_9
@@ -531,7 +531,7 @@ class TestNodeWebsockets(TestApplicationNode):
self.check_close(sock, 1002, no_close=True)
- self.assertEqual(self.recvall(sock, read_timeout=1), b'', 'empty 3_2')
+ self.assertEqual(self.recvall(sock, read_timeout=0.1), b'', 'empty 3_2')
sock.close()
# 3_3
@@ -549,7 +549,7 @@ class TestNodeWebsockets(TestApplicationNode):
self.check_close(sock, 1002, no_close=True)
- self.assertEqual(self.recvall(sock, read_timeout=1), b'', 'empty 3_3')
+ self.assertEqual(self.recvall(sock, read_timeout=0.1), b'', 'empty 3_3')
sock.close()
# 3_4
@@ -567,7 +567,7 @@ class TestNodeWebsockets(TestApplicationNode):
self.check_close(sock, 1002, no_close=True)
- self.assertEqual(self.recvall(sock, read_timeout=1), b'', 'empty 3_4')
+ self.assertEqual(self.recvall(sock, read_timeout=0.1), b'', 'empty 3_4')
sock.close()
# 3_5
@@ -753,7 +753,7 @@ class TestNodeWebsockets(TestApplicationNode):
# 5_4
self.ws.frame_write(sock, self.ws.OP_TEXT, 'fragment1', fin=False)
- self.assertEqual(self.recvall(sock, read_timeout=1), b'', '5_4')
+ self.assertEqual(self.recvall(sock, read_timeout=0.1), b'', '5_4')
self.ws.frame_write(sock, self.ws.OP_CONT, 'fragment2', fin=True)
frame = self.ws.frame_read(sock)
@@ -790,7 +790,7 @@ class TestNodeWebsockets(TestApplicationNode):
ping_payload = 'ping payload'
self.ws.frame_write(sock, self.ws.OP_TEXT, 'fragment1', fin=False)
- self.assertEqual(self.recvall(sock, read_timeout=1), b'', '5_7')
+ self.assertEqual(self.recvall(sock, read_timeout=0.1), b'', '5_7')
self.ws.frame_write(sock, self.ws.OP_PING, ping_payload)
@@ -974,7 +974,7 @@ class TestNodeWebsockets(TestApplicationNode):
frame = self.ws.frame_read(sock)
self.check_frame(frame, True, self.ws.OP_PONG, 'pongme 2!')
- self.assertEqual(self.recvall(sock, read_timeout=1), b'', '5_20')
+ self.assertEqual(self.recvall(sock, read_timeout=0.1), b'', '5_20')
self.ws.frame_write(sock, self.ws.OP_CONT, 'fragment5')
self.check_frame(
@@ -1107,7 +1107,7 @@ class TestNodeWebsockets(TestApplicationNode):
self.check_close(sock, no_close=True)
self.ws.frame_write(sock, self.ws.OP_PING, '')
- self.assertEqual(self.recvall(sock, read_timeout=1), b'', 'empty sock')
+ self.assertEqual(self.recvall(sock, read_timeout=0.1), b'', 'empty soc')
sock.close()
@@ -1119,7 +1119,7 @@ class TestNodeWebsockets(TestApplicationNode):
self.check_close(sock, no_close=True)
self.ws.frame_write(sock, self.ws.OP_TEXT, payload)
- self.assertEqual(self.recvall(sock, read_timeout=1), b'', 'empty sock')
+ self.assertEqual(self.recvall(sock, read_timeout=0.1), b'', 'empty soc')
sock.close()
@@ -1132,7 +1132,7 @@ class TestNodeWebsockets(TestApplicationNode):
self.check_close(sock, no_close=True)
self.ws.frame_write(sock, self.ws.OP_CONT, 'fragment2')
- self.assertEqual(self.recvall(sock, read_timeout=1), b'', 'empty sock')
+ self.assertEqual(self.recvall(sock, read_timeout=0.1), b'', 'empty soc')
sock.close()
@@ -1147,7 +1147,7 @@ class TestNodeWebsockets(TestApplicationNode):
self.recvall(sock, read_timeout=1)
self.ws.frame_write(sock, self.ws.OP_PING, '')
- self.assertEqual(self.recvall(sock, read_timeout=1), b'', 'empty sock')
+ self.assertEqual(self.recvall(sock, read_timeout=0.1), b'', 'empty soc')
sock.close()