mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-08 22:20:53 +00:00
Add mplex tests and fix error in SwarmConn.close
This commit is contained in:
0
tests/stream_muxer/__init__.py
Normal file
0
tests/stream_muxer/__init__.py
Normal file
16
tests/stream_muxer/conftest.py
Normal file
16
tests/stream_muxer/conftest.py
Normal file
@ -0,0 +1,16 @@
|
||||
import asyncio
|
||||
|
||||
import pytest
|
||||
|
||||
from tests.factories import mplex_conn_pair_factory
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
async def mplex_conn_pair(is_host_secure):
|
||||
mplex_conn_0, swarm_0, mplex_conn_1, swarm_1 = await mplex_conn_pair_factory(
|
||||
is_host_secure
|
||||
)
|
||||
try:
|
||||
yield mplex_conn_0, mplex_conn_1
|
||||
finally:
|
||||
await asyncio.gather(*[swarm_0.close(), swarm_1.close()])
|
||||
6
tests/stream_muxer/test_mplex_conn.py
Normal file
6
tests/stream_muxer/test_mplex_conn.py
Normal file
@ -0,0 +1,6 @@
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_mplex_conn(mplex_conn_pair):
|
||||
conn_0, conn_1 = mplex_conn_pair
|
||||
Reference in New Issue
Block a user