本文整理汇总了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()
示例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)
示例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()
示例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()
示例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()
示例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))
示例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)
示例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()
示例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))
示例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))
示例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))
示例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))
示例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))
示例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
示例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()