Ejemplo n.º 1
0
def test_restore_all_backup(mocker):
    from console.services.app_actions.app_deploy import MarketService
    service = ServiceSourceInfo()
    service.service_id = "dummy service_id"
    market_service = MarketService(None, service, "dummy version")
    backup = TenantServiceBackup()
    market_service.restore_func = {
        "deploy_version": market_service.dummy_func,
        "app_version": market_service.dummy_func,
        "image": market_service.dummy_func,
        "slug_path": market_service.dummy_func,
        "envs": market_service.dummy_func,
        "connect_infos": market_service.dummy_func,
        "ports": market_service.dummy_func,
        "volumes": market_service.dummy_func,
        "probe": market_service.dummy_func,
        "dep_services": market_service.dummy_func,
        "dep_volumes": market_service.dummy_func,
        "plugins": market_service.dummy_func,
    }
    logger.debug("market_service.async_action: {}".format(
        market_service.async_action))
    market_service.restore_backup(backup)
    assert 0 == market_service.async_action
    assert 0 == market_service.get_async_action()
Ejemplo n.º 2
0
    def market_service_and_restore_backup(tenant, service, version):
        """创建服务回滚接口并回滚数据库"""
        from console.services.app_actions.app_deploy import MarketService

        market_service = MarketService(tenant, service, version)
        market_service.restore_backup()
        return market_service
Ejemplo n.º 3
0
    def market_service_and_restore_backup(tenant, service, version):
        """创建组件回滚接口并回滚数据库"""
        from console.services.app_actions.app_deploy import MarketService

        # TODO: set app template init MarketService
        market_service = MarketService(tenant, service, version)
        market_service.auto_restore = False
        market_service.restore_backup()
        return market_service