mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-04 06:53:12 +00:00
test: fix preset tests (#3351)
This commit is contained in:
parent
58f76ce467
commit
63cff2ab42
@ -21,7 +21,7 @@ suite "Waku config - apply preset":
|
|||||||
let expectedConf = ClusterConf.TheWakuNetworkConf()
|
let expectedConf = ClusterConf.TheWakuNetworkConf()
|
||||||
|
|
||||||
## Given
|
## Given
|
||||||
let preConfig = WakuNodeConf(cmd: noCommand, preset: "default")
|
let preConfig = WakuNodeConf(cmd: noCommand, preset: "twn")
|
||||||
|
|
||||||
## When
|
## When
|
||||||
let res = applyPresetConfiguration(preConfig)
|
let res = applyPresetConfiguration(preConfig)
|
||||||
@ -41,13 +41,13 @@ suite "Waku config - apply preset":
|
|||||||
assert conf.numShardsInNetwork == expectedConf.numShardsInNetwork
|
assert conf.numShardsInNetwork == expectedConf.numShardsInNetwork
|
||||||
assert conf.discv5BootstrapNodes == expectedConf.discv5BootstrapNodes
|
assert conf.discv5BootstrapNodes == expectedConf.discv5BootstrapNodes
|
||||||
|
|
||||||
test "Subscribes to all valid shards in default network":
|
test "Subscribes to all valid shards in twn":
|
||||||
## Setup
|
## Setup
|
||||||
let expectedConf = ClusterConf.TheWakuNetworkConf()
|
let expectedConf = ClusterConf.TheWakuNetworkConf()
|
||||||
|
|
||||||
## Given
|
## Given
|
||||||
let shards: seq[uint16] = @[0, 1, 2, 3, 4, 5, 6, 7]
|
let shards: seq[uint16] = @[0, 1, 2, 3, 4, 5, 6, 7]
|
||||||
let preConfig = WakuNodeConf(cmd: noCommand, preset: "default", shards: shards)
|
let preConfig = WakuNodeConf(cmd: noCommand, preset: "twn", shards: shards)
|
||||||
|
|
||||||
## When
|
## When
|
||||||
let res = applyPresetConfiguration(preConfig)
|
let res = applyPresetConfiguration(preConfig)
|
||||||
@ -57,13 +57,13 @@ suite "Waku config - apply preset":
|
|||||||
let conf = res.get()
|
let conf = res.get()
|
||||||
assert conf.shards.len == expectedConf.numShardsInNetwork.int
|
assert conf.shards.len == expectedConf.numShardsInNetwork.int
|
||||||
|
|
||||||
test "Subscribes to some valid shards in default network":
|
test "Subscribes to some valid shards in twn":
|
||||||
## Setup
|
## Setup
|
||||||
let expectedConf = ClusterConf.TheWakuNetworkConf()
|
let expectedConf = ClusterConf.TheWakuNetworkConf()
|
||||||
|
|
||||||
## Given
|
## Given
|
||||||
let shards: seq[uint16] = @[0, 4, 7]
|
let shards: seq[uint16] = @[0, 4, 7]
|
||||||
let preConfig = WakuNodeConf(cmd: noCommand, preset: "default", shards: shards)
|
let preConfig = WakuNodeConf(cmd: noCommand, preset: "twn", shards: shards)
|
||||||
|
|
||||||
## When
|
## When
|
||||||
let resConf = applyPresetConfiguration(preConfig)
|
let resConf = applyPresetConfiguration(preConfig)
|
||||||
@ -76,12 +76,12 @@ suite "Waku config - apply preset":
|
|||||||
for index, shard in shards:
|
for index, shard in shards:
|
||||||
assert shard in conf.shards
|
assert shard in conf.shards
|
||||||
|
|
||||||
test "Subscribes to invalid shards in default network":
|
test "Subscribes to invalid shards in twn":
|
||||||
## Setup
|
## Setup
|
||||||
|
|
||||||
## Given
|
## Given
|
||||||
let shards: seq[uint16] = @[0, 4, 7, 10]
|
let shards: seq[uint16] = @[0, 4, 7, 10]
|
||||||
let preConfig = WakuNodeConf(cmd: noCommand, preset: "default", shards: shards)
|
let preConfig = WakuNodeConf(cmd: noCommand, preset: "twn", shards: shards)
|
||||||
let postConfig = applyPresetConfiguration(preConfig)
|
let postConfig = applyPresetConfiguration(preConfig)
|
||||||
|
|
||||||
## When
|
## When
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user