From a26c7783d64271d231dbb83cef9f4a9c44623a7c Mon Sep 17 00:00:00 2001 From: NIC619 Date: Thu, 18 Jul 2019 19:39:57 +0800 Subject: [PATCH] Add `one_to_all_connect` --- tests/pubsub/utils.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/pubsub/utils.py b/tests/pubsub/utils.py index 66916613..e406536e 100644 --- a/tests/pubsub/utils.py +++ b/tests/pubsub/utils.py @@ -122,3 +122,8 @@ async def connect_some(hosts, degree): # await connect(host, neighbor) # j += 1 + +async def one_to_all_connect(hosts, central_host_index): + for i, host in enumerate(hosts): + if i != central_host_index: + await connect(hosts[central_host_index], host)