test_commands.py -> all tests are passing

This commit is contained in:
andrei 2022-05-05 15:40:55 +03:00
parent bb7f6bc143
commit 41a65520d7
3 changed files with 8 additions and 6 deletions

View File

@ -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"]

View File

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

View File

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