Exemple #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()
Exemple #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()
Exemple #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()
Exemple #4
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()
Exemple #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)
Exemple #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()
Exemple #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()
Exemple #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()
Exemple #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)
Exemple #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))
Exemple #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))
Exemple #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()
    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)
Exemple #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)
Exemple #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))
Exemple #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()
Exemple #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))
Exemple #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))
Exemple #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))
 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))
Exemple #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))
Exemple #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))
Exemple #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
Exemple #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))
Exemple #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))
Exemple #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))
Exemple #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
Exemple #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()
Exemple #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()
Exemple #30
0
 def setUp(self):
     super(TestAssemblyController, self).setUp()
     objects.load()
Exemple #31
0
 def setUp(self):
     super(TestImagesController, self).setUp()
     objects.load()
Exemple #32
0
 def setUp(self):
     super(TestPlanController, self).setUp()
     objects.load()
Exemple #33
0
 def setUp(self):
     super(TestSensorController, self).setUp()
     objects.load()
Exemple #34
0
 def setUp(self):
     super(TestPlanController, self).setUp()
     objects.load()
Exemple #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))
Exemple #36
0
 def setUp(self):
     super(TestExtensionController, self).setUp()
     objects.load()
Exemple #37
0
 def setUp(self):
     super(TestPlans, self).setUp()
     objects.load()
Exemple #38
0
 def setUp(self):
     super(TestImagesController, self).setUp()
     objects.load()
Exemple #39
0
def prepare_service(argv=[]):
    cfg.CONF(argv[1:], project='solum')
    logging.setup('solum')
    config.set_config_defaults()
    objects.load()
Exemple #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()
Exemple #43
0
 def setUp(self):
     super(TestPipelineController, self).setUp()
     objects.load()
 def setUp(self):
     super(TestAssemblies, self).setUp()
     objects.load()
Exemple #45
0
 def setUp(self):
     super(TestJSONFormat, self).setUp()
     objects.load()
 def setUp(self):
     super(TestTypeDefinitions, self).setUp()
     objects.load()
Exemple #47
0
 def setUp(self):
     super(TestSensorsController, self).setUp()
     objects.load()
 def setUp(self):
     super(TestPlatformEndpoints, self).setUp()
     objects.load()
Exemple #49
0
 def __init__(self):
     super(Handler, self).__init__()
     objects.load()
Exemple #50
0
 def setUp(self):
     super(TestServices, self).setUp()
     objects.load()
Exemple #51
0
 def setUp(self):
     super(TestExtensions, self).setUp()
     objects.load()
 def setUp(self):
     super(TestInfrastructureStackController, self).setUp()
     objects.load()
Exemple #53
0
 def setUp(self):
     super(TestServiceController, self).setUp()
     objects.load()
Exemple #54
0
 def setUp(self):
     super(TestComponentController, self).setUp()
     objects.load()
Exemple #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))
Exemple #56
0
 def serve(self):
     objects.load()
     self._server.start()
     self._server.wait()