mirror of
https://github.com/planetmint/planetmint.git
synced 2025-11-24 14:35:45 +00:00
test_commands.py -> all tests are passing
This commit is contained in:
parent
bb7f6bc143
commit
41a65520d7
@ -5,7 +5,7 @@
|
||||
|
||||
import logging
|
||||
import tarantool
|
||||
from planetmint.common.exceptions import DatabaseDoesNotExist
|
||||
|
||||
from planetmint.config import Config
|
||||
from planetmint.common.exceptions import ConfigurationError
|
||||
|
||||
@ -57,8 +57,6 @@ class TarantoolDB:
|
||||
db_config = Config().get()["database"]
|
||||
cmd_resp = self.run_command(command=self.drop_path, config=db_config)
|
||||
self._reconnect()
|
||||
# if "nil" in cmd_resp:
|
||||
# raise DatabaseDoesNotExist
|
||||
|
||||
def init_database(self):
|
||||
db_config = Config().get()["database"]
|
||||
|
||||
@ -268,7 +268,10 @@ def run_drop(args):
|
||||
from planetmint.backend.connection import Connection
|
||||
from planetmint.backend import schema
|
||||
conn = Connection()
|
||||
schema.drop_database(conn)
|
||||
try:
|
||||
schema.drop_database(conn)
|
||||
except DatabaseDoesNotExist:
|
||||
print("Drop was executed, but spaces doesn't exist.", file=sys.stderr)
|
||||
|
||||
|
||||
def run_recover(b):
|
||||
|
||||
@ -132,8 +132,9 @@ 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 '{name}'. The database does not exist.\n".format(
|
||||
name=Config().get()['database']['name'])
|
||||
assert output_message == "Drop was executed, but spaces doesn't exist.\n"
|
||||
# assert output_message == "Cannot drop '{name}'. The database does not exist.\n".format(
|
||||
# name=Config().get()['database']['name'])
|
||||
|
||||
|
||||
@patch('planetmint.backend.schema.drop_database')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user