mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
Add fixtures for pubsub and router
And a starting `test_pubsub.py`
This commit is contained in:
11
tests/pubsub/test_pubsub.py
Normal file
11
tests/pubsub/test_pubsub.py
Normal 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
|
||||
Reference in New Issue
Block a user