Add fixtures for pubsub and router

And a starting `test_pubsub.py`
This commit is contained in:
mhchia
2019-07-27 18:41:16 +08:00
parent 21e97407ef
commit 96563c0d84
5 changed files with 126 additions and 6 deletions

View File

@ -0,0 +1,11 @@
import pytest
@pytest.mark.asyncio
async def test_test(pubsubs_fsub):
topic = "topic"
data = b"data"
sub = await pubsubs_fsub[0].subscribe(topic)
await pubsubs_fsub[0].publish(topic, data)
msg = await sub.get()
assert msg.data == data