mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-11 07:30:55 +00:00
Support read/write of noise msg and payload
This commit is contained in:
20
tests/security/noise/test_noise.py
Normal file
20
tests/security/noise/test_noise.py
Normal file
@ -0,0 +1,20 @@
|
||||
import pytest
|
||||
|
||||
from libp2p.tools.factories import noise_conn_factory
|
||||
|
||||
DATA = b"testing_123"
|
||||
|
||||
|
||||
@pytest.mark.trio
|
||||
async def test_noise_transport(nursery):
|
||||
async with noise_conn_factory(nursery):
|
||||
pass
|
||||
|
||||
|
||||
@pytest.mark.trio
|
||||
async def test_noise_connection(nursery):
|
||||
async with noise_conn_factory(nursery) as conns:
|
||||
local_conn, remote_conn = conns
|
||||
await local_conn.write(DATA)
|
||||
read_data = await remote_conn.read(len(DATA))
|
||||
assert read_data == DATA
|
||||
Reference in New Issue
Block a user