• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python core.get_engine函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中tricircle.db.core.get_engine函数的典型用法代码示例。如果您正苦于以下问题:Python get_engine函数的具体用法?Python get_engine怎么用?Python get_engine使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_engine函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: setUp

 def setUp(self):
     core.initialize()
     core.ModelBase.metadata.create_all(core.get_engine())
     # enforce foreign key constraint for sqlite
     core.get_engine().execute('pragma foreign_keys=on')
     self.context = context.Context()
     self.xmanager = FakeXManager()
开发者ID:shipengfei92,项目名称:tricircle,代码行数:7,代码来源:test_xmanager.py


示例2: setUp

 def setUp(self):
     core.initialize()
     core.ModelBase.metadata.create_all(core.get_engine())
     core.get_engine().execute('pragma foreign_keys=on')
     self.context = context.Context()
     xmanager.IN_TEST = True
     directory.get_plugin = fake_get_plugin
开发者ID:daespinel,项目名称:tricircle,代码行数:7,代码来源:test_central_sfc_plugin.py


示例3: setUp

    def setUp(self):
        core.initialize()
        core.ModelBase.metadata.create_all(core.get_engine())
        # enforce foreign key constraint for sqlite
        core.get_engine().execute('pragma foreign_keys=on')
        self.context = context.Context()

        site_dict = {
            'site_id': FAKE_SITE_ID,
            'site_name': FAKE_SITE_NAME,
            'az_id': FAKE_AZ
        }
        config_dict = {
            'service_id': FAKE_SERVICE_ID,
            'site_id': FAKE_SITE_ID,
            'service_type': FAKE_TYPE,
            'service_url': FAKE_URL
        }
        models.create_site(self.context, site_dict)
        models.create_site_service_configuration(self.context, config_dict)

        global FAKE_RESOURCES
        FAKE_RESOURCES = [{'name': 'res1'}, {'name': 'res2'}]

        cfg.CONF.set_override(name='top_site_name', override=FAKE_SITE_NAME,
                              group='client')
        self.client = client.Client()
        self.client.resource_service_map[FAKE_RESOURCE] = FAKE_TYPE
        self.client.operation_resources_map['list'].add(FAKE_RESOURCE)
        self.client.operation_resources_map['create'].add(FAKE_RESOURCE)
        self.client.operation_resources_map['delete'].add(FAKE_RESOURCE)
        self.client.operation_resources_map['action'].add(FAKE_RESOURCE)
        self.client.service_handle_map[FAKE_TYPE] = FakeResHandle(None)
开发者ID:hannibalhuang,项目名称:tricircle,代码行数:33,代码来源:test_client.py


示例4: setUp

 def setUp(self):
     core.initialize()
     core.ModelBase.metadata.create_all(core.get_engine())
     # enforce foreign key constraint for sqlite
     core.get_engine().execute('pragma foreign_keys=on')
     for opt in xservice.common_opts:
         if opt.name in ('worker_handle_timeout', 'job_run_expire',
                         'worker_sleep_time'):
             cfg.CONF.register_opt(opt)
     self.context = context.Context()
     self.xmanager = FakeXManager()
开发者ID:Ronghui,项目名称:tricircle,代码行数:11,代码来源:test_xmanager.py


示例5: setUp

    def setUp(self):
        core.initialize()
        core.ModelBase.metadata.create_all(core.get_engine())
        # enforce foreign key constraint for sqlite
        core.get_engine().execute('pragma foreign_keys=on')
        self.context = context.Context()

        top_pod = {
            'pod_id': FAKE_TOP_ID,
            'pod_name': FAKE_TOP_NAME,
            'az_name': ''
        }

        config_dict_top = {
            'service_id': FAKE_TOP_SERVICE_ID,
            'pod_id': FAKE_TOP_ID,
            'service_type': FAKE_SERVICE_TYPE,
            'service_url': FAKE_TOP_ENDPOINT
        }

        pod_dict = {
            'pod_id': FAKE_SITE_ID,
            'pod_name': FAKE_SITE_NAME,
            'az_name': FAKE_AZ
        }

        pod_dict2 = {
            'pod_id': FAKE_SITE_ID_2,
            'pod_name': FAKE_SITE_NAME_2,
            'az_name': FAKE_AZ
        }

        config_dict = {
            'service_id': FAKE_SERVICE_ID,
            'pod_id': FAKE_SITE_ID,
            'service_type': FAKE_SERVICE_TYPE,
            'service_url': FAKE_SERVICE_ENDPOINT
        }

        config_dict2 = {
            'service_id': FAKE_SERVICE_ID_2,
            'pod_id': FAKE_SITE_ID_2,
            'service_type': FAKE_SERVICE_TYPE,
            'service_url': FAKE_SERVICE_ENDPOINT_2
        }

        api.create_pod(self.context, pod_dict)
        api.create_pod(self.context, pod_dict2)
        api.create_pod(self.context, top_pod)
        api.create_pod_service_configuration(self.context, config_dict)
        api.create_pod_service_configuration(self.context, config_dict2)
        api.create_pod_service_configuration(self.context, config_dict_top)
开发者ID:Ronghui,项目名称:tricircle,代码行数:52,代码来源:test_az_ag.py


示例6: setUp

    def setUp(self):
        super(RoutingControllerTest, self).setUp()

        cfg.CONF.clear()
        cfg.CONF.register_opts(app.common_opts)
        core.initialize()
        core.ModelBase.metadata.create_all(core.get_engine())
        self.controller = routing.RoutingController()
        self.context = context.get_admin_context()
        policy.populate_default_rules()
开发者ID:LongXQ,项目名称:tricircle,代码行数:10,代码来源:test_routing.py


示例7: setUp

    def setUp(self):
        super(AsyncJobControllerTest, self).setUp()

        cfg.CONF.clear()
        cfg.CONF.register_opts(app.common_opts)
        core.initialize()
        core.ModelBase.metadata.create_all(core.get_engine())
        self.controller = FakeAsyncJobController()
        self.context = context.get_admin_context()
        self.job_resource_map = constants.job_resource_map
        policy.populate_default_rules()
开发者ID:LongXQ,项目名称:tricircle,代码行数:11,代码来源:test_job.py


示例8: setUp

    def setUp(self):
        core.initialize()
        core.ModelBase.metadata.create_all(core.get_engine())
        self.context = context.Context()
        xmanager.IN_TEST = True

        def fake_get_plugin(alias='core'):
            if alias == 'trunk':
                return FakePlugin()
            return FakeCorePlugin()
        directory.get_plugin = fake_get_plugin
开发者ID:southeast02,项目名称:tricircle,代码行数:11,代码来源:test_central_trunk_plugin.py


示例9: setUp

    def setUp(self):
        core.initialize()
        core.ModelBase.metadata.create_all(core.get_engine())
        self.context = context.Context()
        self.context.is_admin = True

        root_controller._get_environment = mock.Mock(return_value={})
        root_controller._extract_context_from_environ = mock.Mock(
            return_value=self.context)

        pecan.abort = mock.Mock()
        pecan.response = mock.Mock()
开发者ID:hannibalhuang,项目名称:tricircle,代码行数:12,代码来源:test_root.py


示例10: setUp

    def setUp(self):
        core.initialize()
        core.ModelBase.metadata.create_all(core.get_engine())
        self.context = context.Context()
        cfg.CONF.set_override('tenant_network_types', ['local', 'vlan'],
                              group='tricircle')
        cfg.CONF.set_override('bridge_network_type', 'vlan',
                              group='tricircle')
        xmanager.IN_TEST = True

        def fake_get_plugin(alias='core'):
            if alias == 'trunk':
                return FakePlugin()
            return FakeCorePlugin()
        directory.get_plugin = fake_get_plugin
开发者ID:LongXQ,项目名称:tricircle,代码行数:15,代码来源:test_central_trunk_plugin.py


示例11: setUp

    def setUp(self):
        super(API_FunctionalTest, self).setUp()

        self.addCleanup(set_config, {}, overwrite=True)

        cfg.CONF.register_opts(app.common_opts)

        self.CONF = self.useFixture(fixture_config.Config()).conf

        self.CONF.set_override('auth_strategy', 'noauth')
        self.CONF.set_override('tricircle_db_connection', 'sqlite:///:memory:')

        core.initialize()
        core.ModelBase.metadata.create_all(core.get_engine())

        self.context = context.get_admin_context()

        self.app = self._make_app()
开发者ID:Ronghui,项目名称:tricircle,代码行数:18,代码来源:test_pod.py


示例12: tearDown

 def tearDown(self):
     super(QuotaControllerTest, self).tearDown()
     pecan.set_config({}, overwrite=True)
     cfg.CONF.unregister_opts(app.common_opts)
     core.ModelBase.metadata.drop_all(core.get_engine())
开发者ID:Ronghui,项目名称:tricircle,代码行数:5,代码来源:test_quota_sets.py


示例13: tearDown

 def tearDown(self):
     core.ModelBase.metadata.drop_all(core.get_engine())
     for res in RES_LIST:
         del res[:]
开发者ID:Ronghui,项目名称:tricircle,代码行数:4,代码来源:test_server.py


示例14: setUp

 def setUp(self):
     core.initialize()
     core.ModelBase.metadata.create_all(core.get_engine())
     self.context = context.Context()
     self.project_id = 'test_project'
     self.controller = FakeServerController(self.project_id)
开发者ID:Ronghui,项目名称:tricircle,代码行数:6,代码来源:test_server.py


示例15: setUp

 def setUp(self):
     core.initialize()
     core.ModelBase.metadata.create_all(core.get_engine())
     self.context = context.Context()
开发者ID:MorS25,项目名称:tricircle,代码行数:4,代码来源:test_models.py


示例16: tearDown

 def tearDown(self):
     core.ModelBase.metadata.drop_all(core.get_engine())
开发者ID:MorS25,项目名称:tricircle,代码行数:2,代码来源:test_models.py


示例17: sync_repo

def sync_repo(version):
    repo_abs_path = find_migrate_repo()
    init_version = migrate_repo.DB_INIT_VERSION
    engine = core.get_engine()
    migration.db_sync(engine, repo_abs_path, version, init_version)
开发者ID:Ronghui,项目名称:tricircle,代码行数:5,代码来源:migration_helpers.py


示例18: tearDown

    def tearDown(self):
        cfg.CONF.unregister_opts(app.common_opts)
        core.ModelBase.metadata.drop_all(core.get_engine())

        super(RoutingControllerTest, self).tearDown()
开发者ID:LongXQ,项目名称:tricircle,代码行数:5,代码来源:test_routing.py


示例19: setUp

 def setUp(self):
     core.initialize()
     core.ModelBase.metadata.create_all(core.get_engine())
     self.context = context.get_admin_context()
     self.project_id = 'test_project'
     self.controller = action.ActionController(self.project_id, '')
开发者ID:dingboopt,项目名称:tricircle,代码行数:6,代码来源:test_action.py


示例20: tearDown

 def tearDown(self):
     core.ModelBase.metadata.drop_all(core.get_engine())
     test_utils.get_resource_store().clean()
     cfg.CONF.unregister_opts(q_config.core_opts)
     xmanager.IN_TEST = False
开发者ID:southeast02,项目名称:tricircle,代码行数:5,代码来源:test_central_trunk_plugin.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python core.query_resource函数代码示例发布时间:2022-05-27
下一篇:
Python core.create_resource函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap