mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-10 15:10:54 +00:00
Use asyncio.subprocess over pexpect
In the test for pubsub, since there were unknown issues when I test against pexpect.
This commit is contained in:
@ -5,7 +5,14 @@ from .daemon import make_p2pd
|
||||
|
||||
@pytest.mark.parametrize("num_hosts", (1,))
|
||||
@pytest.mark.asyncio
|
||||
async def test_pubsub_init(
|
||||
hosts, proc_factory, is_host_secure, unused_tcp_port_factory
|
||||
):
|
||||
p2pd = await make_p2pd(proc_factory, unused_tcp_port_factory, is_host_secure)
|
||||
async def test_pubsub_init(hosts, is_host_secure, unused_tcp_port_factory):
|
||||
try:
|
||||
p2pd = await make_p2pd(unused_tcp_port_factory, is_host_secure)
|
||||
host = hosts[0]
|
||||
peers = await p2pd.control.list_peers()
|
||||
assert len(peers) == 0
|
||||
await host.connect(p2pd.peer_info)
|
||||
peers = await p2pd.control.list_peers()
|
||||
assert len(peers) != 0
|
||||
finally:
|
||||
await p2pd.close()
|
||||
|
||||
Reference in New Issue
Block a user