mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-12 16:10:57 +00:00
Add remove_topic_validator test
This commit is contained in:
@ -86,7 +86,7 @@ async def test_get_hello_packet(pubsubs_fsub):
|
|||||||
|
|
||||||
@pytest.mark.parametrize("num_hosts", (1,))
|
@pytest.mark.parametrize("num_hosts", (1,))
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_add_topic_validator(pubsubs_fsub):
|
async def test_set_and_remove_topic_validator(pubsubs_fsub):
|
||||||
|
|
||||||
is_sync_validator_called = False
|
is_sync_validator_called = False
|
||||||
|
|
||||||
@ -131,6 +131,10 @@ async def test_add_topic_validator(pubsubs_fsub):
|
|||||||
assert is_async_validator_called
|
assert is_async_validator_called
|
||||||
assert not is_sync_validator_called
|
assert not is_sync_validator_called
|
||||||
|
|
||||||
|
# Remove validator
|
||||||
|
pubsubs_fsub[0].remove_topic_validator(topic)
|
||||||
|
assert topic not in pubsubs_fsub[0].topic_validators
|
||||||
|
|
||||||
|
|
||||||
class FakeNetStream:
|
class FakeNetStream:
|
||||||
_queue: asyncio.Queue
|
_queue: asyncio.Queue
|
||||||
|
|||||||
Reference in New Issue
Block a user