mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Updated config fixture
Simplified tests.
This commit is contained in:
parent
fafdac2523
commit
4740150f6d
@ -118,9 +118,8 @@ def _configure_bigchaindb(request):
|
|||||||
test_db_name = '{}_{}'.format(TEST_DB_NAME, xdist_suffix)
|
test_db_name = '{}_{}'.format(TEST_DB_NAME, xdist_suffix)
|
||||||
|
|
||||||
backend = request.config.getoption('--database-backend')
|
backend = request.config.getoption('--database-backend')
|
||||||
backend_conf = getattr(bigchaindb, '_database_' + backend)
|
|
||||||
config = {
|
config = {
|
||||||
'database': backend_conf,
|
'database': bigchaindb._database_map[backend],
|
||||||
'keypair': {
|
'keypair': {
|
||||||
'private': '31Lb1ZGKTyHnmVK3LUMrAUrPNfd4sE2YyBt3UA4A25aA',
|
'private': '31Lb1ZGKTyHnmVK3LUMrAUrPNfd4sE2YyBt3UA4A25aA',
|
||||||
'public': '4XYfCbabAWVUCbjTmRTFEu2sc3dFEdkse4r6X498B1s8',
|
'public': '4XYfCbabAWVUCbjTmRTFEu2sc3dFEdkse4r6X498B1s8',
|
||||||
|
@ -23,11 +23,6 @@ def test_bigchain_instance_is_initialized_when_conf_provided(request):
|
|||||||
|
|
||||||
assert bigchaindb.config['CONFIGURED'] is True
|
assert bigchaindb.config['CONFIGURED'] is True
|
||||||
|
|
||||||
# set the current backend so that Bigchain can create a connection
|
|
||||||
backend = request.config.getoption('--database-backend')
|
|
||||||
backend_conf = getattr(bigchaindb, '_database_' + backend)
|
|
||||||
bigchaindb.config['database'] = backend_conf
|
|
||||||
|
|
||||||
b = bigchaindb.Bigchain()
|
b = bigchaindb.Bigchain()
|
||||||
|
|
||||||
assert b.me
|
assert b.me
|
||||||
@ -44,11 +39,6 @@ def test_bigchain_instance_raises_when_not_configured(request, monkeypatch):
|
|||||||
# from existing configurations
|
# from existing configurations
|
||||||
monkeypatch.setattr(config_utils, 'autoconfigure', lambda: 0)
|
monkeypatch.setattr(config_utils, 'autoconfigure', lambda: 0)
|
||||||
|
|
||||||
# set the current backend so that Bigchain can create a connection
|
|
||||||
backend = request.config.getoption('--database-backend')
|
|
||||||
backend_conf = getattr(bigchaindb, '_database_' + backend)
|
|
||||||
bigchaindb.config['database'] = backend_conf
|
|
||||||
|
|
||||||
with pytest.raises(exceptions.KeypairNotFoundException):
|
with pytest.raises(exceptions.KeypairNotFoundException):
|
||||||
bigchaindb.Bigchain()
|
bigchaindb.Bigchain()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user