diff --git a/tests/testidentify.nim b/tests/testidentify.nim index 9b4b1baa0..d193e2d67 100644 --- a/tests/testidentify.nim +++ b/tests/testidentify.nim @@ -1,15 +1,15 @@ import unittest, options import chronos, strutils, sequtils -import ../libp2p/protocols/identify, - ../libp2p/multiaddress, - ../libp2p/peerinfo, - ../libp2p/peer, - ../libp2p/connection, - ../libp2p/multistream, - ../libp2p/transports/transport, - ../libp2p/transports/tcptransport, - ../libp2p/protocols/protocol, - ../libp2p/crypto/crypto +import ../libp2p/[protocols/identify, + multiaddress, + peerinfo, + peer, + connection, + multistream, + transports/transport, + transports/tcptransport, + protocols/protocol, + crypto/crypto] suite "Identify": test "handle identify message": diff --git a/tests/testmplex.nim b/tests/testmplex.nim index 2e59bbc26..f4076e9f5 100644 --- a/tests/testmplex.nim +++ b/tests/testmplex.nim @@ -1,16 +1,16 @@ import unittest, sequtils, sugar, strformat, options, strformat import chronos, nimcrypto/utils, chronicles -import ../libp2p/connection, - ../libp2p/stream/lpstream, - ../libp2p/stream/bufferstream, - ../libp2p/transports/tcptransport, - ../libp2p/transports/transport, - ../libp2p/protocols/identify, - ../libp2p/multiaddress, - ../libp2p/muxers/mplex/mplex, - ../libp2p/muxers/mplex/coder, - ../libp2p/muxers/mplex/types, - ../libp2p/muxers/mplex/lpchannel +import ../libp2p/[connection, + stream/lpstream, + stream/bufferstream, + transports/tcptransport, + transports/transport, + protocols/identify, + multiaddress, + muxers/mplex/mplex, + muxers/mplex/coder, + muxers/mplex/types, + muxers/mplex/lpchannel] suite "Mplex": test "encode header with channel id 0": diff --git a/tests/testpubsub.nim b/tests/testpubsub.nim index bf25000f2..f74efb6f0 100644 --- a/tests/testpubsub.nim +++ b/tests/testpubsub.nim @@ -114,14 +114,14 @@ suite "PubSub": check: waitFor(testBasicPubSub()) == true - test "basic FloodSub": + test "FloodSub multiple peers": proc testBasicFloodSub(): Future[bool] {.async.} = var passed: int proc handler(topic: string, data: seq[byte]) {.async, gcsafe.} = check topic == "foobar" passed.inc() - var nodes: seq[Switch] = generateNodes(20) + var nodes: seq[Switch] = generateNodes(10) var awaitters: seq[Future[void]] for node in nodes: awaitters.add(await node.start()) @@ -138,7 +138,7 @@ suite "PubSub": await allFutures(nodes.mapIt(it.stop())) await allFutures(awaitters) - result = passed == 20 + result = passed == 10 check: waitFor(testBasicFloodSub()) == true diff --git a/tests/testtransport.nim b/tests/testtransport.nim index 0119fe43f..70af9f44c 100644 --- a/tests/testtransport.nim +++ b/tests/testtransport.nim @@ -1,10 +1,10 @@ import unittest import chronos -import ../libp2p/connection, - ../libp2p/transports/transport, - ../libp2p/transports/tcptransport, - ../libp2p/multiaddress, - ../libp2p/wire +import ../libp2p/[connection, + transports/transport, + transports/tcptransport, + multiaddress, + wire] suite "TCP transport": test "test listener: handle write":