mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
Noise: add noise option in the factories and tests
This commit is contained in:
@ -8,8 +8,11 @@ from libp2p.tools.factories import host_pair_factory
|
||||
|
||||
|
||||
@pytest.mark.trio
|
||||
async def test_ping_once(is_host_secure):
|
||||
async with host_pair_factory(is_host_secure) as (host_a, host_b):
|
||||
async def test_ping_once(security_protocol):
|
||||
async with host_pair_factory(security_protocol=security_protocol) as (
|
||||
host_a,
|
||||
host_b,
|
||||
):
|
||||
stream = await host_b.new_stream(host_a.get_id(), (ID,))
|
||||
some_ping = secrets.token_bytes(PING_LENGTH)
|
||||
await stream.write(some_ping)
|
||||
@ -23,8 +26,11 @@ SOME_PING_COUNT = 3
|
||||
|
||||
|
||||
@pytest.mark.trio
|
||||
async def test_ping_several(is_host_secure):
|
||||
async with host_pair_factory(is_host_secure) as (host_a, host_b):
|
||||
async def test_ping_several(security_protocol):
|
||||
async with host_pair_factory(security_protocol=security_protocol) as (
|
||||
host_a,
|
||||
host_b,
|
||||
):
|
||||
stream = await host_b.new_stream(host_a.get_id(), (ID,))
|
||||
for _ in range(SOME_PING_COUNT):
|
||||
some_ping = secrets.token_bytes(PING_LENGTH)
|
||||
|
||||
Reference in New Issue
Block a user