mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
Add helper functions
This commit is contained in:
@ -1,7 +1,19 @@
|
||||
import asyncio
|
||||
|
||||
import pytest
|
||||
|
||||
from .utils import connect
|
||||
|
||||
|
||||
TOPIC = "TOPIC_0123"
|
||||
|
||||
|
||||
@pytest.mark.parametrize("num_hosts", (1,))
|
||||
@pytest.mark.asyncio
|
||||
async def test_gossipsub(pubsubs_gsub, p2pds):
|
||||
pass
|
||||
async def test_pubsub_peers(pubsubs_gsub, p2pds):
|
||||
# await connect(pubsubs_gsub[0].host, p2pds[0])
|
||||
await connect(p2pds[0], pubsubs_gsub[0].host)
|
||||
sub = await pubsubs_gsub[0].subscribe(TOPIC)
|
||||
await asyncio.sleep(1)
|
||||
peers = await p2pds[0].control.pubsub_list_peers(TOPIC)
|
||||
print(f"!@# peers={peers}")
|
||||
|
||||
Reference in New Issue
Block a user