Rename to set_topic_validator and add test

This commit is contained in:
NIC619
2019-08-04 11:03:29 +08:00
parent b1f4813195
commit cf69f7e800
2 changed files with 49 additions and 1 deletions

View File

@ -161,7 +161,7 @@ class Pubsub:
# Force context switch
await asyncio.sleep(0)
def add_topic_validator(
def set_topic_validator(
self, topic: str, validator: ValidatorFn, is_async_validator: bool
) -> None:
self.topic_validators[topic] = TopicValidator(validator, is_async_validator)