bigchaindb/tests/commands/conftest.py
Troy McConaghy 241db4ee48 Problem: backlog_reassign_delay is defunct but still listed (#2332)
* Fixed 2 PEP257 compliance errors

* Upgrade Tendermint to 0.19.7 except for Docker image, which is still at 0.19.2

* Problem: backlog_reassign_delay is defunct but still listed

Solution: remove all mentions of & calls for backlog_reassign_delay
2018-06-04 12:19:24 +02:00

60 lines
1.5 KiB
Python

from argparse import Namespace
import pytest
@pytest.fixture
def mock_run_configure(monkeypatch):
from bigchaindb.commands import bigchaindb
monkeypatch.setattr(bigchaindb, 'run_configure', lambda *args, **kwargs: None)
@pytest.fixture
def mock_write_config(monkeypatch):
from bigchaindb import config_utils
monkeypatch.setattr(config_utils, 'write_config', lambda *args: None)
@pytest.fixture
def mock_db_init_with_existing_db(monkeypatch):
from bigchaindb.commands import bigchaindb
monkeypatch.setattr(bigchaindb, '_run_init', lambda: None)
@pytest.fixture
def mock_processes_start(monkeypatch):
from bigchaindb import processes
monkeypatch.setattr(processes, 'start', lambda *args: None)
@pytest.fixture
def mock_generate_key_pair(monkeypatch):
monkeypatch.setattr('bigchaindb.common.crypto.generate_key_pair', lambda: ('privkey', 'pubkey'))
@pytest.fixture
def mock_bigchaindb_backup_config(monkeypatch):
config = {
'keypair': {},
'database': {'host': 'host', 'port': 12345, 'name': 'adbname'},
}
monkeypatch.setattr('bigchaindb._config', config)
@pytest.fixture
def run_start_args(request):
param = getattr(request, 'param', {})
return Namespace(
config=param.get('config'),
skip_initialize_database=param.get('skip_initialize_database', False),
)
@pytest.fixture
def mocked_setup_logging(mocker):
return mocker.patch(
'bigchaindb.commands.utils.setup_logging',
autospec=True,
spec_set=True,
)