Browse Source

Updated test_failed_weak_ref

pull/296/merge
Sheng 2 years ago
parent
commit
9238c01c35
  1. 3
      tests/test_handler.py

3
tests/test_handler.py

@ -283,9 +283,11 @@ class TestWsockHandler(unittest.TestCase):
request = HTTPServerRequest(uri='/')
obj = Mock(spec=WsockHandler, request=request)
obj.src_addr = ("127.0.0.1", 8888)
class FakeWeakRef:
def __init__(self):
self.count = 0
def __call__(self):
self.count += 1
return None
@ -294,3 +296,4 @@ class TestWsockHandler(unittest.TestCase):
obj.worker_ref = ref
WsockHandler.on_message(obj, b'{"data": "somestuff"}')
self.assertGreaterEqual(ref.count, 1)
obj.close.assert_called_with(reason='No worker found')

Loading…
Cancel
Save