mirror of
https://github.com/planetmint/planetmint.git
synced 2025-11-25 15:05:49 +00:00
1 Test case fails: tests/backend/tarantool/test_schema.py::test_drop - AssertionError: assert [] == ['abci_chains...ta_data', ...]
This commit is contained in:
parent
ef8dbff7a5
commit
109f50bec9
@ -20,6 +20,13 @@ BACKENDS = {
|
|||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
class DBSingleton(type):
|
||||||
|
_instances = {}
|
||||||
|
|
||||||
|
def __call__(cls, *args, **kwargs):
|
||||||
|
if cls not in cls._instances:
|
||||||
|
cls._instances[cls] = super(DBSingleton, cls).__call__(*args, **kwargs)
|
||||||
|
return cls._instances[cls]
|
||||||
|
|
||||||
def connect(host: str = None, port: int = None, login: str = None, password: str = None, backend: str = None,
|
def connect(host: str = None, port: int = None, login: str = None, password: str = None, backend: str = None,
|
||||||
**kwargs):
|
**kwargs):
|
||||||
@ -81,7 +88,7 @@ def _kwargs_parser(key, kwargs):
|
|||||||
return kwargs[key]
|
return kwargs[key]
|
||||||
return None
|
return None
|
||||||
|
|
||||||
class Connection:
|
class Connection(metaclass=DBSingleton):
|
||||||
"""Connection class interface.
|
"""Connection class interface.
|
||||||
All backend implementations should provide a connection class that inherits
|
All backend implementations should provide a connection class that inherits
|
||||||
from and implements this class.
|
from and implements this class.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user