2019-08-29 21:38:06 +08:00
|
|
|
import pytest
|
|
|
|
|
2019-11-21 11:47:54 +08:00
|
|
|
from libp2p.tools.factories import HostFactory
|
2019-08-29 21:38:06 +08:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
2020-02-19 23:15:03 +08:00
|
|
|
def security_protocol():
|
|
|
|
return None
|
2019-08-29 21:38:06 +08:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
|
def num_hosts():
|
|
|
|
return 3
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
2020-02-19 23:15:03 +08:00
|
|
|
async def hosts(num_hosts, security_protocol, nursery):
|
|
|
|
async with HostFactory.create_batch_and_listen(
|
|
|
|
num_hosts, security_protocol=security_protocol
|
|
|
|
) as _hosts:
|
2019-08-29 21:38:06 +08:00
|
|
|
yield _hosts
|