mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
fixed tests
This commit is contained in:
parent
8e8a60a539
commit
9d03aeb72a
@ -378,6 +378,7 @@ def test_calling_main(start_mock, base_parser_mock, parse_args_mock,
|
||||
assert start_mock.called is True
|
||||
|
||||
|
||||
@pytest.mark.usefixtures('ignore_local_config_file')
|
||||
@patch('bigchaindb.backend.admin.add_replicas')
|
||||
def test_run_add_replicas(mock_add_replicas):
|
||||
from bigchaindb.commands.bigchain import run_add_replicas
|
||||
@ -398,6 +399,7 @@ def test_run_add_replicas(mock_add_replicas):
|
||||
assert run_add_replicas(args) is None
|
||||
|
||||
|
||||
@pytest.mark.usefixtures('ignore_local_config_file')
|
||||
@patch('bigchaindb.backend.admin.remove_replicas')
|
||||
def test_run_remove_replicas(mock_remove_replicas):
|
||||
from bigchaindb.commands.bigchain import run_remove_replicas
|
||||
|
@ -131,6 +131,26 @@ def test_autoconfigure_read_both_from_file_and_env(monkeypatch, request):
|
||||
from bigchaindb import config_utils
|
||||
config_utils.autoconfigure()
|
||||
|
||||
backend = request.config.getoption('--database-backend')
|
||||
database_rethinkdb = {
|
||||
'backend': 'rethinkdb',
|
||||
'host': 'test-host',
|
||||
'port': 4242,
|
||||
'name': 'test-dbname',
|
||||
}
|
||||
database_mongodb = {
|
||||
'backend': 'mongodb',
|
||||
'host': 'test-host',
|
||||
'port': 4242,
|
||||
'name': 'test-dbname',
|
||||
'replicaset': 'bigchain-rs',
|
||||
}
|
||||
|
||||
# default
|
||||
database = database_rethinkdb
|
||||
if backend == 'mongodb':
|
||||
database = database_mongodb
|
||||
|
||||
assert bigchaindb.config == {
|
||||
'CONFIGURED': True,
|
||||
'server': {
|
||||
@ -138,12 +158,7 @@ def test_autoconfigure_read_both_from_file_and_env(monkeypatch, request):
|
||||
'workers': None,
|
||||
'threads': None,
|
||||
},
|
||||
'database': {
|
||||
'backend': request.config.getoption('--database-backend'),
|
||||
'host': 'test-host',
|
||||
'port': 4242,
|
||||
'name': 'test-dbname',
|
||||
},
|
||||
'database': database,
|
||||
'keypair': {
|
||||
'public': None,
|
||||
'private': None,
|
||||
|
Loading…
x
Reference in New Issue
Block a user