mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-11 23:51:07 +00:00
Add tests for MplexStream
This commit is contained in:
@ -2,7 +2,7 @@ import asyncio
|
||||
|
||||
import pytest
|
||||
|
||||
from tests.factories import mplex_conn_pair_factory
|
||||
from tests.factories import mplex_conn_pair_factory, mplex_stream_pair_factory
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@ -16,3 +16,14 @@ async def mplex_conn_pair(is_host_secure):
|
||||
yield mplex_conn_0, mplex_conn_1
|
||||
finally:
|
||||
await asyncio.gather(*[swarm_0.close(), swarm_1.close()])
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
async def mplex_stream_pair(is_host_secure):
|
||||
mplex_stream_0, swarm_0, mplex_stream_1, swarm_1 = await mplex_stream_pair_factory(
|
||||
is_host_secure
|
||||
)
|
||||
try:
|
||||
yield mplex_stream_0, mplex_stream_1
|
||||
finally:
|
||||
await asyncio.gather(*[swarm_0.close(), swarm_1.close()])
|
||||
|
||||
Reference in New Issue
Block a user