From ae03f0ccfd2d6bb4c283f342c596e561e2e14cd8 Mon Sep 17 00:00:00 2001 From: Chih Cheng Liang Date: Mon, 8 Apr 2019 10:51:59 +0800 Subject: [PATCH] test new state machine class and new chain class are well defined --- .../chains/{test_chain.py => test_beacon_chain.py} | 0 tests/eth2/beacon/chains/test_chains.py | 13 +++++++++++++ .../state_machines/forks/test_fork_classes.py | 13 +++++++++++++ 3 files changed, 26 insertions(+) rename tests/eth2/beacon/chains/{test_chain.py => test_beacon_chain.py} (100%) create mode 100644 tests/eth2/beacon/chains/test_chains.py create mode 100644 tests/eth2/beacon/state_machines/forks/test_fork_classes.py diff --git a/tests/eth2/beacon/chains/test_chain.py b/tests/eth2/beacon/chains/test_beacon_chain.py similarity index 100% rename from tests/eth2/beacon/chains/test_chain.py rename to tests/eth2/beacon/chains/test_beacon_chain.py diff --git a/tests/eth2/beacon/chains/test_chains.py b/tests/eth2/beacon/chains/test_chains.py new file mode 100644 index 0000000000..32347ab65a --- /dev/null +++ b/tests/eth2/beacon/chains/test_chains.py @@ -0,0 +1,13 @@ +import pytest +from eth2.beacon.chains.testnet import TestnetChain + + +@pytest.mark.parametrize( + "chain_klass", + ( + TestnetChain, + ) +) +def test_chain_class_well_defined(chain_klass): + chain = chain_klass(None) + assert chain.sm_configuration is not () diff --git a/tests/eth2/beacon/state_machines/forks/test_fork_classes.py b/tests/eth2/beacon/state_machines/forks/test_fork_classes.py new file mode 100644 index 0000000000..7733dd503f --- /dev/null +++ b/tests/eth2/beacon/state_machines/forks/test_fork_classes.py @@ -0,0 +1,13 @@ +import pytest +from eth2.beacon.state_machines.forks.xiao_long_bao import XiaoLongBaoStateMachine + + +@pytest.mark.parametrize( + "sm_klass", + ( + XiaoLongBaoStateMachine, + ) +) +def test_sm_class_well_defined(sm_klass): + state_machine = sm_klass(chaindb=None, block=None) + assert state_machine.get_block_class()