예제 #1
0
 def setUpClass(self):
     UserTest.test_token = tokenutils.generate_auth_token(
         'password', 'admin', 60)
     models.initialize_models({
         'database.name': ':memory:',
         'database.type': 'sqlite'
     })
예제 #2
0
 def test_initialize_models(self):
     models.initialize_models({
         'database.name': ':memory:',
         'database.type': 'sqlite'
     })
     self.assertTrue(models.Registration.table_exists())
     self.assertTrue(models.User.table_exists())
예제 #3
0
 def setUpClass(self):
     models.initialize_models({
         'database.name': ':memory:',
         'database.type': 'sqlite'
     })
     iam.create('user', 'some_password')
     EventTest.auth_header = {
         'Authorization':
         tokenutils.generate_auth_token('password', 'user', 120)
     }
예제 #4
0
 def setUpClass(self):
     models.initialize_models({'database.name': ':memory:',
                               'database.type': 'sqlite'})
     iam.create('user', 'some_password')
     EventTest.auth_header = {
         'Authorization': tokenutils.generate_auth_token(
             'password',
             'user',
             120)
     }
예제 #5
0
 def setUpClass(self):
     models.initialize_models({'database.name': ':memory:',
                               'database.type': 'sqlite'})
     iam.create('user', 'some_password')
     RegistrationTest.test_user = models.User.get(models.User.id == 'user')
     RegistrationTest.auth_header = {
         'Authorization': tokenutils.generate_auth_token(
             'password',
             RegistrationTest.test_user.id,
             120)
     }
예제 #6
0
 def setUpClass(self):
     models.initialize_models({
         'database.name': ':memory:',
         'database.type': 'sqlite'
     })
     iam.create('user', 'some_password')
     RegistrationTest.test_user = models.User.get(models.User.id == 'user')
     RegistrationTest.auth_header = {
         'Authorization':
         tokenutils.generate_auth_token('password',
                                        RegistrationTest.test_user.id, 120)
     }
예제 #7
0
 def setUpClass(self):
     models.initialize_models({'database.name': ':memory:',
                               'database.type': 'sqlite'})
     iam.create('user', 'some_password')
     MetricsTest.test_user = models.User.get(models.User.id == 'user')
     MetricsTest.auth_header = {
         'Authorization': tokenutils.generate_auth_token(
             'password',
             MetricsTest.test_user.id,
             120)
     }
     MetricsTest.registration_id = models.Registration.create(
         topic=MetricsTest.topic,
         container=MetricsTest.container,
         creator=MetricsTest.test_user
     ).id
예제 #8
0
 def setUpClass(self):
     models.initialize_models({'database.name': ':memory:',
                               'database.type': 'sqlite'})
예제 #9
0
 def test_initialize_models(self):
     models.initialize_models({"database.name": ":memory:", "database.type": "sqlite"})
     self.assertTrue(models.Registration.table_exists())
     self.assertTrue(models.User.table_exists())
예제 #10
0
 def setUpClass(self):
     UserTest.test_token = tokenutils.generate_auth_token("password", "admin", 60)
     models.initialize_models({"database.name": ":memory:", "database.type": "sqlite"})
예제 #11
0
 def setUpClass(self):
     models.initialize_models({
         'database.name': ':memory:',
         'database.type': 'sqlite'
     })
예제 #12
0
from bakula.bottle import configuration

app = Bottle()

# To add a subapplication simply do the necessary imports and add the
# application to the list below
sub_apps = [
    healthcheck.app, registration.app, user.app, event.app, images.app,
    metrics.app
]

if __name__ == '__main__':
    parser = argparse.ArgumentParser(description='Bakula server')
    parser.add_argument('-H',
                        '--host',
                        help='host address',
                        default='localhost')
    parser.add_argument('-P',
                        '--port',
                        help='port of the bakula server',
                        default='5000')

    args = parser.parse_args()

    for sub_app in sub_apps:
        app.merge(sub_app)

    configuration.bootstrap_app_config(app)
    initialize_models(app.config)
    run(app, host=args.host, port=args.port, server='cherrypy')
예제 #13
0
from bakula.bottle import configuration

app = Bottle()

# To add a subapplication simply do the necessary imports and add the
# application to the list below
sub_apps = [
    healthcheck.app,
    registration.app,
    user.app,
    event.app,
    images.app,
    metrics.app
]

if __name__ == '__main__':
    parser = argparse.ArgumentParser(description='Bakula server')
    parser.add_argument('-H', '--host', help='host address',
                        default='localhost')
    parser.add_argument('-P', '--port', help='port of the bakula server',
                        default='5000')

    args = parser.parse_args()

    for sub_app in sub_apps:
        app.merge(sub_app)

    configuration.bootstrap_app_config(app)
    initialize_models(app.config)
    run(app, host=args.host, port=args.port, server='cherrypy')