Add is_gossipsub fixture in interop test

To use the same code to test against both routers: floodsub and
gossipsub.
This commit is contained in:
mhchia
2019-09-03 16:49:00 +08:00
parent 33dae87c35
commit 7385a7a677
7 changed files with 86 additions and 60 deletions

View File

@ -14,7 +14,8 @@ from .utils import dense_connect, one_to_all_connect
((4, GossipsubParams(degree=4, degree_low=3, degree_high=5)),),
)
@pytest.mark.asyncio
async def test_join(num_hosts, hosts, gossipsubs, pubsubs_gsub):
async def test_join(num_hosts, hosts, pubsubs_gsub):
gossipsubs = tuple(pubsub.router for pubsub in pubsubs_gsub)
hosts_indices = list(range(num_hosts))
topic = "test_join"
@ -85,7 +86,9 @@ async def test_leave(pubsubs_gsub):
@pytest.mark.parametrize("num_hosts", (2,))
@pytest.mark.asyncio
async def test_handle_graft(pubsubs_gsub, hosts, gossipsubs, event_loop, monkeypatch):
async def test_handle_graft(pubsubs_gsub, hosts, event_loop, monkeypatch):
gossipsubs = tuple(pubsub.router for pubsub in pubsubs_gsub)
index_alice = 0
id_alice = hosts[index_alice].get_id()
index_bob = 1