Example #1
0
 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()
Example #2
0
 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()
Example #3
0
 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()
Example #4
0
File: utils.py Project: alex/solum
 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()
Example #5
0
    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)
Example #6
0
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()
Example #7
0
 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()
Example #8
0
 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()
Example #9
0
    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)
Example #10
0
 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))
Example #11
0
 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))
Example #12
0
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()
Example #13
0
    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)
Example #14
0
    def test_objects_reloadable(self):
        self.assertIsNotNone(objects.registry.Plan)

        objects.registry.clear()

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

        objects.load()

        self.assertIsNotNone(objects.registry.Plan)
Example #15
0
 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))
Example #16
0
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()
Example #17
0
 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))
Example #18
0
 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))
Example #19
0
 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))
Example #20
0
 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))
Example #21
0
    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))
Example #22
0
 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))
Example #23
0
    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
Example #24
0
 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))
Example #25
0
 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))
Example #26
0
    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))
Example #27
0
    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
Example #28
0
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()
Example #29
0
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()
Example #30
0
 def setUp(self):
     super(TestAssemblyController, self).setUp()
     objects.load()
Example #31
0
 def setUp(self):
     super(TestImagesController, self).setUp()
     objects.load()
Example #32
0
 def setUp(self):
     super(TestPlanController, self).setUp()
     objects.load()
Example #33
0
 def setUp(self):
     super(TestSensorController, self).setUp()
     objects.load()
Example #34
0
 def setUp(self):
     super(TestPlanController, self).setUp()
     objects.load()
Example #35
0
 def test_as_dict(self):
     objects.load()
     s = model.Sensor(**self.data)
     self.data.pop('uri', None)
     self.data.pop('type', None)
     self.assertEqual(self.data, s.as_dict(objects.registry.Sensor))
Example #36
0
 def setUp(self):
     super(TestExtensionController, self).setUp()
     objects.load()
Example #37
0
 def setUp(self):
     super(TestPlans, self).setUp()
     objects.load()
Example #38
0
 def setUp(self):
     super(TestImagesController, self).setUp()
     objects.load()
Example #39
0
def prepare_service(argv=[]):
    cfg.CONF(argv[1:], project='solum')
    logging.setup('solum')
    config.set_config_defaults()
    objects.load()
Example #40
0
 def setUp(self):
     super(TestPlans, self).setUp()
     objects.load()
 def setUp(self):
     super(TestAttributeDefinitions, self).setUp()
     objects.load()
 def setUp(self):
     super(TestParameterDefinitions, self).setUp()
     objects.load()
Example #43
0
 def setUp(self):
     super(TestPipelineController, self).setUp()
     objects.load()
Example #44
0
 def setUp(self):
     super(TestAssemblies, self).setUp()
     objects.load()
Example #45
0
 def setUp(self):
     super(TestJSONFormat, self).setUp()
     objects.load()
 def setUp(self):
     super(TestTypeDefinitions, self).setUp()
     objects.load()
Example #47
0
 def setUp(self):
     super(TestSensorsController, self).setUp()
     objects.load()
 def setUp(self):
     super(TestPlatformEndpoints, self).setUp()
     objects.load()
Example #49
0
 def __init__(self):
     super(Handler, self).__init__()
     objects.load()
Example #50
0
 def setUp(self):
     super(TestServices, self).setUp()
     objects.load()
Example #51
0
 def setUp(self):
     super(TestExtensions, self).setUp()
     objects.load()
Example #52
0
 def setUp(self):
     super(TestInfrastructureStackController, self).setUp()
     objects.load()
Example #53
0
 def setUp(self):
     super(TestServiceController, self).setUp()
     objects.load()
Example #54
0
 def setUp(self):
     super(TestComponentController, self).setUp()
     objects.load()
Example #55
0
 def test_as_dict(self):
     objects.load()
     s = model.Sensor(**self.data)
     self.data.pop('uri', None)
     self.data.pop('type', None)
     self.assertEqual(self.data, s.as_dict(objects.registry.Sensor))
Example #56
0
 def serve(self):
     objects.load()
     self._server.start()
     self._server.wait()