本文整理汇总了Python中depot.manager.DepotManager._clear方法的典型用法代码示例。如果您正苦于以下问题:Python DepotManager._clear方法的具体用法?Python DepotManager._clear怎么用?Python DepotManager._clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类depot.manager.DepotManager
的用法示例。
在下文中一共展示了DepotManager._clear方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setup
# 需要导入模块: from depot.manager import DepotManager [as 别名]
# 或者: from depot.manager.DepotManager import _clear [as 别名]
def setup():
setup_database()
DepotManager._clear()
DepotManager.configure("default", {"depot.storage_path": "./lfs"})
DepotManager.configure("another", {"depot.storage_path": "./lfs"})
DepotManager.alias("another_alias", "another")
DepotManager.make_middleware(None)
示例2: depot
# 需要导入模块: from depot.manager import DepotManager [as 别名]
# 或者: from depot.manager.DepotManager import _clear [as 别名]
def depot(temporary_directory):
DepotManager.configure('default', {
'depot.backend': 'depot.io.local.LocalFileStorage',
'depot.storage_path': temporary_directory
})
yield DepotManager.get()
DepotManager._clear()
示例3: test_default_filedepot
# 需要导入模块: from depot.manager import DepotManager [as 别名]
# 或者: from depot.manager.DepotManager import _clear [as 别名]
def test_default_filedepot(self, db_session):
from kotti import main
from depot.manager import DepotManager
settings = self.required_settings()
with patch("kotti.resources.initialize_sql"):
with patch("kotti.filedepot.TweenFactory"):
main({}, **settings)
assert DepotManager.get().__class__.__name__ == "DBFileStorage"
DepotManager._clear()
示例4: tearDown
# 需要导入模块: from depot.manager import DepotManager [as 别名]
# 或者: from depot.manager.DepotManager import _clear [as 别名]
def tearDown(self) -> None:
logger.debug(self, 'TearDown Test...')
self.session.rollback()
self.session.close_all()
transaction.abort()
DeclarativeBase.metadata.drop_all(self.engine)
sql = text('DROP TABLE IF EXISTS migrate_version;')
result = self.engine.execute(sql)
self.engine.dispose()
DepotManager._clear()
testing.tearDown()
示例5: no_filedepots
# 需要导入模块: from depot.manager import DepotManager [as 别名]
# 或者: from depot.manager.DepotManager import _clear [as 别名]
def no_filedepots(db_session, depot_tween):
""" A filedepot fixture to empty and then restore DepotManager configuration
"""
from depot.manager import DepotManager
DepotManager._depots = {}
DepotManager._default_depot = None
yield DepotManager
db_session.rollback()
DepotManager._clear()
示例6: filedepot
# 需要导入模块: from depot.manager import DepotManager [as 别名]
# 或者: from depot.manager.DepotManager import _clear [as 别名]
def filedepot(db_session, depot_tween):
""" Configures a dbsession integrated mock depot store for
:class:`depot.manager.DepotManager`
"""
from depot.manager import DepotManager
DepotManager._depots = {"filedepot": MagicMock(wraps=TestStorage())}
DepotManager._default_depot = "filedepot"
yield DepotManager
db_session.rollback()
DepotManager._clear()
示例7: mock_filedepot
# 需要导入模块: from depot.manager import DepotManager [as 别名]
# 或者: from depot.manager.DepotManager import _clear [as 别名]
def mock_filedepot(depot_tween):
""" Configures a mock depot store for :class:`depot.manager.DepotManager`
This filedepot is not integrated with dbsession.
Can be used in simple, standalone unit tests.
"""
from depot.manager import DepotManager
DepotManager._depots = {"mockdepot": MagicMock(wraps=TestStorage())}
DepotManager._default_depot = "mockdepot"
yield DepotManager
DepotManager._clear()
示例8: tearDown
# 需要导入模块: from depot.manager import DepotManager [as 别名]
# 或者: from depot.manager.DepotManager import _clear [as 别名]
def tearDown():
from depot.manager import DepotManager
from kotti import events
from kotti import security
from kotti.message import _inject_mailer
# These should arguable use the configurator, so they don't need
# to be torn down separately:
events.clear()
security.reset()
_inject_mailer[:] = []
transaction.abort()
DepotManager._clear()
testing.tearDown()
示例9: setup
# 需要导入模块: from depot.manager import DepotManager [as 别名]
# 或者: from depot.manager.DepotManager import _clear [as 别名]
def setup(self):
DepotManager._clear()
DepotManager.configure('default', {'depot.storage_path': './lfs'})
示例10: setup
# 需要导入模块: from depot.manager import DepotManager [as 别名]
# 或者: from depot.manager.DepotManager import _clear [as 别名]
def setup():
setup_database()
DepotManager._clear()
DepotManager.configure('default', {'depot.storage_path': './lfs'})
示例11: restore
# 需要导入模块: from depot.manager import DepotManager [as 别名]
# 或者: from depot.manager.DepotManager import _clear [as 别名]
def restore():
db_session.rollback()
DepotManager._clear()
示例12: setup
# 需要导入模块: from depot.manager import DepotManager [as 别名]
# 或者: from depot.manager.DepotManager import _clear [as 别名]
def setup(self):
DepotManager._clear()