Add remove_topic_validator test

This commit is contained in:
NIC619 2019-08-04 11:11:35 +08:00
parent cf69f7e800
commit 1ed14d0cc8
No known key found for this signature in database
GPG Key ID: 570C35F5C2D51B17

View File

@ -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