mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-09 22:50:54 +00:00
Add checkpoints in tests
This commit is contained in:
@ -154,6 +154,7 @@ async def test_get_msg_validators():
|
|||||||
async def async_validator(peer_id, msg):
|
async def async_validator(peer_id, msg):
|
||||||
nonlocal times_async_validator_called
|
nonlocal times_async_validator_called
|
||||||
times_async_validator_called += 1
|
times_async_validator_called += 1
|
||||||
|
await trio.hazmat.checkpoint()
|
||||||
|
|
||||||
topic_1 = "TEST_VALIDATOR_1"
|
topic_1 = "TEST_VALIDATOR_1"
|
||||||
topic_2 = "TEST_VALIDATOR_2"
|
topic_2 = "TEST_VALIDATOR_2"
|
||||||
@ -199,9 +200,11 @@ async def test_validate_msg(is_topic_1_val_passed, is_topic_2_val_passed):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
async def passed_async_validator(peer_id, msg):
|
async def passed_async_validator(peer_id, msg):
|
||||||
|
await trio.hazmat.checkpoint()
|
||||||
return True
|
return True
|
||||||
|
|
||||||
async def failed_async_validator(peer_id, msg):
|
async def failed_async_validator(peer_id, msg):
|
||||||
|
await trio.hazmat.checkpoint()
|
||||||
return False
|
return False
|
||||||
|
|
||||||
topic_1 = "TEST_SYNC_VALIDATOR"
|
topic_1 = "TEST_SYNC_VALIDATOR"
|
||||||
|
|||||||
Reference in New Issue
Block a user