From 4493cad6d6b833990cdde35a243b5d0bc8acc2e1 Mon Sep 17 00:00:00 2001 From: z-bowen Date: Wed, 12 Sep 2018 14:11:08 +0200 Subject: [PATCH] Problem: `MigrationElection` needed to be added to the allowed operations Solution: Added it --- tests/commands/test_commands.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/commands/test_commands.py b/tests/commands/test_commands.py index 97073940..6b8930f3 100644 --- a/tests/commands/test_commands.py +++ b/tests/commands/test_commands.py @@ -343,6 +343,28 @@ def test_election_new_upsert_validator_without_tendermint(caplog, b, priv_valida assert b.get_transaction(election_id) +@pytest.mark.bdb +def test_election_new_migration_without_tendermint(caplog, b, priv_validator_path, user_sk): + from bigchaindb.commands.bigchaindb import run_election_new_migration + + def mock_write(tx, mode): + b.store_bulk_transactions([tx]) + return (202, '') + + b.get_validators = mock_get_validators + b.write_transaction = mock_write + + args = Namespace(action='new', + election_type='migration', + sk=priv_validator_path, + config={}) + + with caplog.at_level(logging.INFO): + election_id = run_election_new_migration(args, b) + assert caplog.records[0].msg == '[SUCCESS] Submitted proposal with id: ' + election_id + assert b.get_transaction(election_id) + + @pytest.mark.bdb def test_election_new_upsert_validator_invalid_election(caplog, b, priv_validator_path, user_sk): from bigchaindb.commands.bigchaindb import run_election_new_upsert_validator