Noise: add noise option in the factories and tests

This commit is contained in:
mhchia
2020-02-19 23:15:03 +08:00
parent 1d2a976597
commit 13e8f496a7
21 changed files with 331 additions and 212 deletions

View File

@ -92,8 +92,11 @@ async def no_common_protocol(host_a, host_b):
"test", [(hello_world), (connect_write), (connect_read), (no_common_protocol)]
)
@pytest.mark.trio
async def test_chat(test, is_host_secure):
async with HostFactory.create_batch_and_listen(is_host_secure, 2) as hosts:
async def test_chat(test, security_protocol):
print("!@# ", security_protocol)
async with HostFactory.create_batch_and_listen(
2, security_protocol=security_protocol
) as hosts:
addr = hosts[0].get_addrs()[0]
info = info_from_p2p_addr(addr)
await hosts[1].connect(info)