mirror of
https://github.com/codex-storage/nim-codex-dht.git
synced 2025-02-10 19:06:36 +00:00
chore: bump asynctest, use all/each test harness nouns
Using `setupAll`/`setupEach` and `teardownAll`/`teardownEach` for test harnesses.
This commit is contained in:
parent
acd03ff831
commit
55a43b2d89
@ -20,5 +20,5 @@ requires "nim >= 1.2.0",
|
||||
"secp256k1 >= 0.5.2 & < 0.6.0",
|
||||
"stew#head",
|
||||
"stint",
|
||||
"asynctest#88ae00ea288c93b23d0111da4868127a1426f39d" # >= 0.3.0 & < 0.4.0"
|
||||
"asynctest#ae29b86f62923f53e7ccae760126f79bc721c6c6" # >= 0.3.0 & < 0.4.0"
|
||||
# "testutils >= 0.4.2 & < 0.5.0"
|
||||
|
@ -82,13 +82,13 @@ suite "Providers Tests: node alone":
|
||||
nodes: seq[ProvidersProtocol]
|
||||
targetId: NodeId
|
||||
|
||||
before:
|
||||
setupAll:
|
||||
debug "RUNNING BEFORE TESTS"
|
||||
rng = keys.newRng()
|
||||
nodes = bootstrapNetwork(nodecount=1)
|
||||
targetId = toNodeId(keys.PrivateKey.random(rng[]).toPublicKey)
|
||||
|
||||
after:
|
||||
teardownAll:
|
||||
debug "RUNNING AFTER TESTS"
|
||||
for n in nodes:
|
||||
await n.discovery.closeWait()
|
||||
@ -133,12 +133,12 @@ suite "Providers Tests: two nodes":
|
||||
nodes: seq[ProvidersProtocol]
|
||||
targetId: NodeId
|
||||
|
||||
before:
|
||||
setupAll:
|
||||
rng = keys.newRng()
|
||||
nodes = bootstrapNetwork(nodecount=2)
|
||||
targetId = toNodeId(keys.PrivateKey.random(rng[]).toPublicKey)
|
||||
|
||||
after:
|
||||
teardownAll:
|
||||
for n in nodes:
|
||||
await n.discovery.closeWait()
|
||||
await sleepAsync(chronos.seconds(3))
|
||||
@ -173,14 +173,14 @@ suite "Providers Tests: 20 nodes":
|
||||
nodes: seq[ProvidersProtocol]
|
||||
targetId: NodeId
|
||||
|
||||
before:
|
||||
setupAll:
|
||||
rng = keys.newRng()
|
||||
nodes = bootstrapNetwork(nodecount=20)
|
||||
targetId = toNodeId(keys.PrivateKey.random(rng[]).toPublicKey)
|
||||
|
||||
await sleepAsync(chronos.seconds(15))
|
||||
|
||||
after:
|
||||
teardownAll:
|
||||
for n in nodes[1..^1]:
|
||||
await n.discovery.closeWait()
|
||||
|
||||
|
@ -12,7 +12,7 @@ import
|
||||
suite "Discovery v5 Tests":
|
||||
var rng: ref HmacDrbgContext
|
||||
|
||||
setup:
|
||||
setupEach:
|
||||
rng = newRng()
|
||||
|
||||
test "GetNode":
|
||||
|
@ -256,7 +256,7 @@ suite "Discovery v5.1 Packet Encodings Test Vectors":
|
||||
nodeA, nodeB: Node
|
||||
privKeyA, privKeyB: PrivateKey
|
||||
|
||||
setup:
|
||||
setupEach:
|
||||
privKeyA = PrivateKey.fromHex(nodeAKey)[] # sender -> encode
|
||||
privKeyB = PrivateKey.fromHex(nodeBKey)[] # receive -> decode
|
||||
|
||||
@ -486,7 +486,7 @@ suite "Discovery v5.1 Additional Encode/Decode":
|
||||
nodeA, nodeB: Node
|
||||
privKeyA, privKeyB: PrivateKey
|
||||
|
||||
setup:
|
||||
setupEach:
|
||||
privKeyA = PrivateKey.random(rng[]) # sender -> encode
|
||||
privKeyB = PrivateKey.random(rng[]) # receiver -> decode
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user