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


Python objects.load函数代码示例

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


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

示例1: setUp

 def setUp(self):
     super(Database, self).setUp()
     self.configure()
     self.addCleanup(objects.IMPL.cleanup)
     models.Base.metadata.create_all(objects.IMPL.get_engine())
     objects.IMPL.get_engine().connect()
     objects.load()
开发者ID:BeenzSyed,项目名称:solum,代码行数:7,代码来源:utils.py

示例2: test_objects_reloadable

    def test_objects_reloadable(self):
        objects.load()
        assert objects.registry.Application

        self.addCleanup(objects.load)
        objects.registry.clear()

        self.assertRaises(AttributeError, lambda: base.registry.Application)
开发者ID:smarterclayton,项目名称:solum,代码行数:8,代码来源:test_objects.py

示例3: prepare_service

def prepare_service(argv=None):
    if argv is None:
        argv = []
    log.register_options(cfg.CONF)
    config.set_config_defaults()
    cfg.CONF(argv[1:], project='solum')
    log.setup(cfg.CONF, 'solum')
    objects.load()
开发者ID:openstack,项目名称:solum,代码行数:8,代码来源:service.py

示例4: setUp

 def setUp(self):
     super(Database, self).setUp()
     self.configure()
     self.upgrade()
     self.addCleanup(self.engine.dispose)
     self.engine = session.get_engine()
     self.engine.connect()
     objects.load()
开发者ID:alex,项目名称:solum,代码行数:8,代码来源:utils.py

示例5: setUp

 def setUp(self):
     super(Database, self).setUp()
     self.configure()
     self.addCleanup(self.engine.dispose)
     self.engine = session.get_engine()
     models.Base.metadata.create_all(self.engine)
     self.engine.connect()
     objects.load()
开发者ID:jamesyli,项目名称:solum,代码行数:8,代码来源:utils.py

示例6: test_as_dict

 def test_as_dict(self):
     objects.load()
     if self.data is None:
         s = model.Extension()
         self.data = {}
     else:
         s = model.Extension(**self.data)
     self.data.pop('uri', None)
     self.data.pop('type', None)
     self.assertEqual(self.data, s.as_dict(objects.registry.Extension))
开发者ID:jamesyli,项目名称:solum,代码行数:10,代码来源:test_extension.py

示例7: test_objects_reloadable

    def test_objects_reloadable(self):
        self.assertIsNotNone(objects.registry.Component)

        objects.registry.clear()

        with testtools.ExpectedException(KeyError):
            objects.registry.Component

        objects.load()

        self.assertIsNotNone(objects.registry.Component)
开发者ID:jamesyli,项目名称:solum,代码行数:11,代码来源:test_objects_sqlalchemy.py

示例8: prepare_service

def prepare_service(argv=[]):
    cfg.set_defaults(log.log_opts,
                     default_log_levels=['amqplib=WARN',
                                         'qpid.messaging=INFO',
                                         'sqlalchemy=WARN',
                                         'keystoneclient=INFO',
                                         'stevedore=INFO',
                                         'eventlet.wsgi.server=WARN'
                                         ])
    cfg.CONF(argv[1:], project='solum')
    log.setup('solum')
    objects.load()
开发者ID:smarterclayton,项目名称:solum,代码行数:12,代码来源:service.py

示例9: test_as_dict

 def test_as_dict(self):
     objects.load()
     if self.data is None:
         s = operationmodel.Operation()
         self.data = {}
     else:
         s = operationmodel.Operation(**self.data)
     if 'uri' in self.data:
         del self.data['uri']
     if 'type' in self.data:
         del self.data['type']
     self.assertEqual(self.data, s.as_dict(objects.registry.Operation))
开发者ID:BeenzSyed,项目名称:solum,代码行数:12,代码来源:test_operation.py

示例10: test_as_dict

    def test_as_dict(self):
        objects.load()
        if self.data is None:
            s = assemblymodel.Assembly()
            self.data = {}
        else:
            s = assemblymodel.Assembly(**self.data)
        if 'uri' in self.data:
            del self.data['uri']
        if 'type' in self.data:
            del self.data['type']

        self.assertEqual(self.data, s.as_dict(objects.registry.Assembly))
开发者ID:julienvey,项目名称:solum,代码行数:13,代码来源:test_assembly.py

示例11: test_as_dict

 def test_as_dict(self):
     objects.load()
     if self.data is None:
         s = inframodel.InfrastructureStack()
         self.data = {}
     else:
         s = inframodel.InfrastructureStack(**self.data)
     if 'uri' in self.data:
         del self.data['uri']
     if 'type' in self.data:
         del self.data['type']
     self.assertEqual(self.data, s.as_dict(
         objects.registry.InfrastructureStack))
开发者ID:BeenzSyed,项目名称:solum,代码行数:13,代码来源:test_infrastructure.py

示例12: test_as_dict

 def test_as_dict(self):
     objects.load()
     if self.data is None:
         s = servicemodel.Service()
         self.data = {}
     else:
         s = servicemodel.Service(**self.data)
     if 'uri' in self.data:
         del self.data['uri']
     if 'type' in self.data:
         del self.data['type']
     self.assertEqual(self.data,
                      s.as_dict(objects.registry.Service))
开发者ID:pravisankar,项目名称:solum,代码行数:13,代码来源:test_service.py

示例13: test_as_dict

 def test_as_dict(self):
     objects.load()
     if self.data is None:
         s = componentmodel.Component()
         self.data = {}
     else:
         s = componentmodel.Component(**self.data)
     if 'uri' in self.data:
         del self.data['uri']
     if 'type' in self.data:
         del self.data['type']
     self.assertEqual(self.data,
                      s.as_dict(objects.registry.Component))
开发者ID:pravisankar,项目名称:solum,代码行数:13,代码来源:test_component.py

示例14: test_object_persist_and_retrieve

    def test_object_persist_and_retrieve(self):
        objects.load()
        app = objects.registry.Application()
        assert app
        app.create(self.ctx)
        assert app.id is not None

        app2 = objects.registry.Application.get_by_id(None, app.id)
        assert app2
        assert app.id == app2.id

        query = utils.get_dummy_session().query(app.__class__).filter_by(id=app.id)
        assert query.first().id == app.id
开发者ID:smarterclayton,项目名称:solum,代码行数:13,代码来源:test_objects.py

示例15: init_application

def init_application():
    i18n.enable_lazy()

    LOG = logging.getLogger('solum.api')

    logging.register_options(cfg.CONF)
    cfg.CONF(project='solum')
    logging.setup(cfg.CONF, 'solum')

    config.set_config_defaults()
    objects.load()

    port = cfg.CONF.api.port
    host = cfg.CONF.api.host
    LOG.info(('Starting Solum REST API on %(host)s:%(port)s'),
             {'host': host, 'port': port})
    return api_app.setup_app()
开发者ID:openstack,项目名称:solum,代码行数:17,代码来源:solum_api.py


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