mirror of
https://github.com/status-im/nim-libp2p.git
synced 2025-01-20 18:00:04 +00:00
Remove mock and comment test.
This commit is contained in:
parent
e53d041305
commit
0db9812b38
@ -32,7 +32,7 @@ import
|
||||
protocols/pubsub/rpc/messages,
|
||||
]
|
||||
import ../../libp2p/protocols/pubsub/errors as pubsub_errors
|
||||
import ../helpers, ../utils/[async, futures, async, mock]
|
||||
import ../helpers, ../utils/[async, futures, async, mock, tests]
|
||||
|
||||
proc `$`(peer: PubSubPeer): string =
|
||||
shortLog(peer)
|
||||
@ -278,14 +278,9 @@ suite "GossipSub":
|
||||
|
||||
await allFuturesThrowing(nodes[0].switch.stop(), nodes[1].switch.stop())
|
||||
|
||||
asyncTest "GossipSub unsub - resub faster than backoff":
|
||||
# Mock replenishFanout so it doesn't interfere with publishing, otherwise it's used as a backup mechanism during backoff period
|
||||
let backup = behavior.replenishFanout
|
||||
mock(behavior.replenishFanout):
|
||||
proc mockedReplenishFanout(g: GossipSub) {.async.} =
|
||||
discard
|
||||
|
||||
mockedReplenishFanout
|
||||
xasyncTest "GossipSub unsub - resub faster than backoff":
|
||||
# For this test to work we'd require a way to disable fanout.
|
||||
# There's not a way to toggle it, and mocking it didn't work as there's not a reliable mock available.
|
||||
|
||||
# Instantiate handlers and validators
|
||||
var handlerFut0 = newFuture[bool]()
|
||||
@ -362,9 +357,6 @@ suite "GossipSub":
|
||||
handlerFut1.toResult().isOk()
|
||||
handlerFut0.toResult().error() == "Future still not finished."
|
||||
|
||||
# Cleanup
|
||||
mock(behavior.replenishFanout):
|
||||
backup
|
||||
await allFuturesThrowing(nodes[0].switch.stop(), nodes[1].switch.stop())
|
||||
await allFuturesThrowing(nodesFut.concat())
|
||||
|
||||
|
29
tests/utils/tests.nim
Normal file
29
tests/utils/tests.nim
Normal file
@ -0,0 +1,29 @@
|
||||
import testutils/unittests
|
||||
|
||||
template xsuite*(name: string, body: untyped) =
|
||||
discard
|
||||
|
||||
template suitex*(name: string, body: untyped) =
|
||||
discard
|
||||
|
||||
template xprocSuite*(name: string, body: untyped) =
|
||||
discard
|
||||
|
||||
template procSuitex*(name: string, body: untyped) =
|
||||
discard
|
||||
|
||||
template xtest*(name: string, body: untyped) =
|
||||
test name:
|
||||
skip()
|
||||
|
||||
template testx*(name: string, body: untyped) =
|
||||
test name:
|
||||
skip()
|
||||
|
||||
template xasyncTest*(name: string, body: untyped) =
|
||||
test name:
|
||||
skip()
|
||||
|
||||
template asyncTestx*(name: string, body: untyped) =
|
||||
test name:
|
||||
skip()
|
Loading…
x
Reference in New Issue
Block a user