当前位置: 首页>>代码示例>>Python>>正文


Python DepotManager._clear方法代码示例

本文整理汇总了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)
开发者ID:rlam3,项目名称:depot,代码行数:10,代码来源:test_fields_sqlalchemy.py

示例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()
开发者ID:OneGov,项目名称:onegov.file,代码行数:11,代码来源:conftest.py

示例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()
开发者ID:Kotti,项目名称:Kotti,代码行数:13,代码来源:test_app.py

示例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()
开发者ID:tracim,项目名称:tracim,代码行数:14,代码来源:test_migration.py

示例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()
开发者ID:Kotti,项目名称:Kotti,代码行数:14,代码来源:__init__.py

示例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()
开发者ID:Kotti,项目名称:Kotti,代码行数:15,代码来源:__init__.py

示例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()
开发者ID:Kotti,项目名称:Kotti,代码行数:16,代码来源:__init__.py

示例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()
开发者ID:Kotti,项目名称:Kotti,代码行数:17,代码来源:testing.py

示例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'})
开发者ID:dirn,项目名称:depot,代码行数:5,代码来源:test_wsgi_middleware.py

示例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'})
开发者ID:adamchainz,项目名称:depot,代码行数:7,代码来源:test_fields_basic.py

示例11: restore

# 需要导入模块: from depot.manager import DepotManager [as 别名]
# 或者: from depot.manager.DepotManager import _clear [as 别名]
 def restore():
     db_session.rollback()
     DepotManager._clear()
开发者ID:adamchainz,项目名称:Kotti,代码行数:5,代码来源:__init__.py

示例12: setup

# 需要导入模块: from depot.manager import DepotManager [as 别名]
# 或者: from depot.manager.DepotManager import _clear [as 别名]
 def setup(self):
     DepotManager._clear()
开发者ID:adamchainz,项目名称:depot,代码行数:4,代码来源:test_depot_manager.py


注:本文中的depot.manager.DepotManager._clear方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。