mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Taking DB name from config in test for non-existent db drop
This commit is contained in:
parent
ffad192ca8
commit
c3f89fd447
@ -151,6 +151,7 @@ def test_drop_db_when_interactive_yes(mock_db_drop, monkeypatch):
|
||||
|
||||
@patch('bigchaindb.backend.schema.drop_database')
|
||||
def test_drop_db_when_db_does_not_exist(mock_db_drop, capsys):
|
||||
from bigchaindb import config
|
||||
from bigchaindb.commands.bigchain import run_drop
|
||||
from bigchaindb.common.exceptions import DatabaseDoesNotExist
|
||||
args = Namespace(config=None, yes=True)
|
||||
@ -158,7 +159,8 @@ def test_drop_db_when_db_does_not_exist(mock_db_drop, capsys):
|
||||
|
||||
run_drop(args)
|
||||
output_message = capsys.readouterr()[1]
|
||||
assert output_message == "Cannot drop 'bigchain'. The database does not exist.\n"
|
||||
assert output_message == "Cannot drop '{name}'. The database does not exist.\n".format(
|
||||
name=config['database']['name'])
|
||||
|
||||
|
||||
@patch('bigchaindb.backend.schema.drop_database')
|
||||
|
Loading…
x
Reference in New Issue
Block a user