Skip to content

Commit e9ecefa

Browse files
committed
Fix old test that was not working as expected.
1 parent ed2d7a2 commit e9ecefa

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tests/core/providers/test_websocket_provider.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,13 @@ async def test_listen_event_awaits_msg_processing_when_subscription_queue_is_ful
270270
sub_request_information = RequestInformation(
271271
method=RPCEndpoint("eth_subscribe"),
272272
params=["mock"],
273-
response_formatters=(),
273+
response_formatters=[[], [], []],
274274
subscription_id=sub_id,
275275
)
276276
async_w3.provider._request_processor._request_information_cache.cache(
277-
"", sub_request_information
277+
# cache key is the result of `generate_cache_key` with the sub_id as the arg
278+
"0138b5d63d66121d8a6e680d23720fa7",
279+
sub_request_information,
278280
)
279281

280282
mocked_sub = {
@@ -305,8 +307,8 @@ async def test_listen_event_awaits_msg_processing_when_subscription_queue_is_ful
305307
async_w3.provider._listen_event.set.assert_not_called()
306308

307309
async for message in async_w3.socket.process_subscriptions():
308-
# assert the very next message is the mocked subscription
309-
assert message == mocked_sub
310+
# assert the very next message is the formatted mocked subscription
311+
assert message == mocked_sub["params"]
310312
break
311313

312314
# assert we set the _listen_event after we consume the message

0 commit comments

Comments
 (0)