Taking DB name from config in test for non-existent db drop

This commit is contained in:
Anuj 2017-04-03 13:13:22 +05:30
parent ffad192ca8
commit c3f89fd447

View File

@ -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')