py-libp2p/tests/pubsub/test_pubsub.py
mhchia 96563c0d84
Add fixtures for pubsub and router
And a starting `test_pubsub.py`
2019-07-31 14:14:13 +08:00

12 lines
261 B
Python

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