From 1ed14d0cc8d30c242d32498b5f9f6333c1a49298 Mon Sep 17 00:00:00 2001 From: NIC619 Date: Sun, 4 Aug 2019 11:11:35 +0800 Subject: [PATCH] Add `remove_topic_validator` test --- tests/pubsub/test_pubsub.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/pubsub/test_pubsub.py b/tests/pubsub/test_pubsub.py index 438c48b..5a397f8 100644 --- a/tests/pubsub/test_pubsub.py +++ b/tests/pubsub/test_pubsub.py @@ -86,7 +86,7 @@ async def test_get_hello_packet(pubsubs_fsub): @pytest.mark.parametrize("num_hosts", (1,)) @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 @@ -131,6 +131,10 @@ async def test_add_topic_validator(pubsubs_fsub): assert is_async_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: _queue: asyncio.Queue