Пример #1
0
def test_election_new_chain_migration_with_tendermint(b, priv_validator_path, user_sk, validators):
    from bigchaindb.commands.bigchaindb import run_election_new_chain_migration

    new_args = Namespace(action='new',
                         election_type='migration',
                         sk=priv_validator_path,
                         config={})

    election_id = run_election_new_chain_migration(new_args, b)

    assert b.get_transaction(election_id)
Пример #2
0
def test_election_new_chain_migration_with_tendermint(b, priv_validator_path,
                                                      user_sk, validators):
    from bigchaindb.commands.bigchaindb import run_election_new_chain_migration

    new_args = Namespace(action='new',
                         election_type='migration',
                         sk=priv_validator_path,
                         config={})

    election_id = run_election_new_chain_migration(new_args, b)

    assert b.get_transaction(election_id)
Пример #3
0
def test_election_new_chain_migration_without_tendermint(caplog, b, priv_validator_path, user_sk):
    from bigchaindb.commands.bigchaindb import run_election_new_chain_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_chain_migration(args, b)
        assert caplog.records[0].msg == '[SUCCESS] Submitted proposal with id: ' + election_id
        assert b.get_transaction(election_id)
Пример #4
0
def test_election_new_chain_migration_without_tendermint(
        caplog, b, priv_validator_path, user_sk):
    from bigchaindb.commands.bigchaindb import run_election_new_chain_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_chain_migration(args, b)
        assert caplog.records[
            0].msg == '[SUCCESS] Submitted proposal with id: ' + election_id
        assert b.get_transaction(election_id)