c61a06706a
- Add `close` and `disconnect` in `Host` - Add `close` and `close_peer` in `Network` - Change `IListener.close` to async, to await for server's closing - Add factories for security transports, and modify `HostFactory`
29 lines
743 B
Python
29 lines
743 B
Python
import functools
|
|
|
|
import pytest
|
|
|
|
from tests.factories import GossipsubFactory
|
|
|
|
from .configs import FLOODSUB_PROTOCOL_ID
|
|
from .floodsub_integration_test_settings import (
|
|
floodsub_protocol_pytest_params,
|
|
perform_test_from_obj,
|
|
)
|
|
|
|
|
|
@pytest.mark.asyncio
|
|
async def test_gossipsub_initialize_with_floodsub_protocol():
|
|
GossipsubFactory(protocols=[FLOODSUB_PROTOCOL_ID])
|
|
|
|
|
|
@pytest.mark.parametrize("test_case_obj", floodsub_protocol_pytest_params)
|
|
@pytest.mark.asyncio
|
|
@pytest.mark.slow
|
|
async def test_gossipsub_run_with_floodsub_tests(test_case_obj):
|
|
await perform_test_from_obj(
|
|
test_case_obj,
|
|
functools.partial(
|
|
GossipsubFactory, degree=3, degree_low=2, degree_high=4, time_to_live=30
|
|
),
|
|
)
|