Skip to content

Commit

Permalink
Fix old test that was not working as expected.
Browse files Browse the repository at this point in the history
  • Loading branch information
fselmo committed Dec 13, 2024
1 parent 4dc96ea commit 8644827
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/core/providers/test_websocket_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,13 @@ async def test_listen_event_awaits_msg_processing_when_subscription_queue_is_ful
sub_request_information = RequestInformation(
method=RPCEndpoint("eth_subscribe"),
params=["mock"],
response_formatters=(),
response_formatters=[[], [], []],
subscription_id=sub_id,
)
async_w3.provider._request_processor._request_information_cache.cache(
"", sub_request_information
# cache key is the result of `generate_cache_key` with the sub_id as the arg
"0138b5d63d66121d8a6e680d23720fa7",
sub_request_information,
)

mocked_sub = {
Expand Down Expand Up @@ -305,8 +307,8 @@ async def test_listen_event_awaits_msg_processing_when_subscription_queue_is_ful
async_w3.provider._listen_event.set.assert_not_called()

async for message in async_w3.socket.process_subscriptions():
# assert the very next message is the mocked subscription
assert message == mocked_sub
# assert the very next message is the formatted mocked subscription
assert message == mocked_sub["params"]
break

# assert we set the _listen_event after we consume the message
Expand Down

0 comments on commit 8644827

Please sign in to comment.