Skip to content

Commit

Permalink
Updated test_failed_weak_ref
Browse files Browse the repository at this point in the history
  • Loading branch information
huashengdun committed Nov 21, 2022
1 parent 2a46b52 commit 9238c01
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/test_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,11 @@ def test_failed_weak_ref(self):
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
Expand All @@ -294,3 +296,4 @@ def __call__(self):
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')

0 comments on commit 9238c01

Please sign in to comment.