mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-11 15:40:54 +00:00
Noise: add noise option in the factories and tests
This commit is contained in:
@ -4,14 +4,18 @@ from libp2p.tools.factories import mplex_conn_pair_factory, mplex_stream_pair_fa
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
async def mplex_conn_pair(is_host_secure):
|
||||
async with mplex_conn_pair_factory(is_host_secure) as mplex_conn_pair:
|
||||
async def mplex_conn_pair(security_protocol):
|
||||
async with mplex_conn_pair_factory(
|
||||
security_protocol=security_protocol
|
||||
) as mplex_conn_pair:
|
||||
assert mplex_conn_pair[0].is_initiator
|
||||
assert not mplex_conn_pair[1].is_initiator
|
||||
yield mplex_conn_pair[0], mplex_conn_pair[1]
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
async def mplex_stream_pair(is_host_secure):
|
||||
async with mplex_stream_pair_factory(is_host_secure) as mplex_stream_pair:
|
||||
async def mplex_stream_pair(security_protocol):
|
||||
async with mplex_stream_pair_factory(
|
||||
security_protocol=security_protocol
|
||||
) as mplex_stream_pair:
|
||||
yield mplex_stream_pair
|
||||
|
||||
Reference in New Issue
Block a user