2023-11-04 23:22:33 +00:00
|
|
|
# nim-raft
|
|
|
|
# Copyright (c) 2023 Status Research & Development GmbH
|
|
|
|
# Licensed under either of
|
|
|
|
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE))
|
|
|
|
# * MIT license ([LICENSE-MIT](LICENSE-MIT))
|
|
|
|
# at your option.
|
|
|
|
# This file may not be copied, modified, or distributed except according to
|
|
|
|
# those terms.
|
|
|
|
|
|
|
|
import unittest2
|
2023-11-05 18:38:56 +00:00
|
|
|
import ../raft/types
|
2023-11-05 16:29:28 +00:00
|
|
|
import basic_state_machine
|
2023-11-04 23:22:33 +00:00
|
|
|
import ../raft/consensus_state_machine
|
|
|
|
|
|
|
|
suite "Create and test Consensus State Machine":
|
|
|
|
|
2023-11-05 04:42:19 +00:00
|
|
|
test "Create Consensus State Machine":
|
2023-11-05 18:38:56 +00:00
|
|
|
var
|
|
|
|
csm = ConsensusFsm[RaftNodeState, EventType, RaftNode[SmCommand, SmState], RaftMessageBase[SmCommand, SmState]].new(rnsFollower)
|
|
|
|
|
2023-11-05 04:42:19 +00:00
|
|
|
check csm != nil
|