mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
Fix all tests
- Dedup `perform_test_from_obj` and the test cases used in both `test_floodsub` and `test_gossipsub_backward_compatibility.py`. Therefore, they are put in the standalone file `tests/pubsub/floodsub_integration_test_settings.py`. The functions and testcases are imported from there then. - IMO still need a refactor on the tests. There are still some duplicate code.
This commit is contained in:
@ -1,11 +1,12 @@
|
||||
import asyncio
|
||||
import multiaddr
|
||||
import uuid
|
||||
import random
|
||||
import struct
|
||||
from typing import (
|
||||
Sequence,
|
||||
)
|
||||
import uuid
|
||||
|
||||
import multiaddr
|
||||
|
||||
from libp2p import new_node
|
||||
from libp2p.pubsub.pb import rpc_pb2
|
||||
@ -93,8 +94,17 @@ async def create_libp2p_hosts(num_hosts):
|
||||
|
||||
return hosts
|
||||
|
||||
def create_pubsub_and_gossipsub_instances(libp2p_hosts, supported_protocols, degree, degree_low, \
|
||||
degree_high, time_to_live, gossip_window, gossip_history, heartbeat_interval):
|
||||
|
||||
def create_pubsub_and_gossipsub_instances(
|
||||
libp2p_hosts,
|
||||
supported_protocols,
|
||||
degree,
|
||||
degree_low,
|
||||
degree_high,
|
||||
time_to_live,
|
||||
gossip_window,
|
||||
gossip_history,
|
||||
heartbeat_interval):
|
||||
pubsubs = []
|
||||
gossipsubs = []
|
||||
for node in libp2p_hosts:
|
||||
|
||||
Reference in New Issue
Block a user