Ejemplo n.º 1
0
 def setUpClass(cls):
     from gooutsafe import create_app
     app = create_app()
     cls.client = app.test_client()
     from tests.models.test_reservation import TestReservation
     cls.test_reservation = TestReservation
     from gooutsafe.dao import reservation_manager
     cls.reservation_manager = reservation_manager.ReservationManager
Ejemplo n.º 2
0
 def setUpClass(cls):
     from gooutsafe import create_app
     app = create_app()
     cls.client = app.test_client()
     from tests.models.test_customer import TestCustomer
     cls.test_customer = TestCustomer
     from gooutsafe.dao import customer_manager
     cls.customer_manager = customer_manager.CustomerManager
     from tests.models.test_operator import TestOperator
     cls.test_operator = TestOperator
     from gooutsafe.dao import operator_manager
     cls.operator_manager = operator_manager.OperatorManager
     from tests.models.test_authority import TestAuthority
     cls.test_authority = TestAuthority
     from gooutsafe.dao import health_authority_manager
     cls.authority_manager = health_authority_manager.AuthorityManager
Ejemplo n.º 3
0
 def setUpClass(cls):
     from gooutsafe import create_app
     create_app()
Ejemplo n.º 4
0
"""
Go Out Safe
Web Server Gateway Interface

This file is the entry point for
gooutsafe-reservations-ms microservice.
"""
from gooutsafe import create_app

# application instance
app = create_app()

if __name__ == '__main__':
    app.run()
PATH_HEALTH_AUTH_DATA = 'example_data/health_authority.json'


def load_health_auth_data():
    with open(PATH_HEALTH_AUTH_DATA) as json_file:
        dict_health_auth = json.load(json_file)

    email = dict_health_auth["email"]
    password = generate_password_hash(dict_health_auth["password"])
    name = dict_health_auth["name"]
    city = dict_health_auth["city"]
    address = dict_health_auth["address"]
    phone = dict_health_auth["phone"]

    from gooutsafe.models import health_authority
    lha = health_authority.Authority(email=email,
                                     password=password,
                                     name=name,
                                     city=city,
                                     address=address,
                                     phone=phone)

    from gooutsafe.dao.health_authority_manager import AuthorityManager
    AuthorityManager.create_authority(lha)


if __name__ == "__main__":
    gooutsafe.create_app()
    load_health_auth_data()
Ejemplo n.º 6
0
 def setUpClass(cls):
     from gooutsafe import create_app
     cls.app = create_app()
     cls.client = cls.app.test_client()
     from gooutsafe.rao.user_manager import UserManager
     cls.user_manager = UserManager
Ejemplo n.º 7
0
 def setUp(self):
     from gooutsafe import create_app
     self.app = create_app()
Ejemplo n.º 8
0
 def setUpClass(cls):
     from gooutsafe import create_app
     cls.app = create_app()
     cls.client = cls.app.test_client()
Ejemplo n.º 9
0
"""
Background entry point.
"""
from gooutsafe import create_app
from gooutsafe.comm import BackgroundWorkers
import logging

# creating application starting the broker
app = create_app(broker_start=True, log_level=logging.INFO)

# creating the manager object
background_workers = BackgroundWorkers()


def main():
    import signal

    def signal_handler(signo, frame):
        app.logger.info('Sending stop to background workers...')
        background_workers.stop()

    signal.signal(signal.SIGINT, signal_handler)
    signal.signal(signal.SIGTERM, signal_handler)

    # starting workers
    background_workers.start()


if __name__ == '__main__':
    main()
Ejemplo n.º 10
0
from gooutsafe import create_app, create_celery

flask_app = create_app()
app = create_celery(flask_app)

try:
    import gooutsafe.tasks
except ImportError:
    raise RuntimeError('Cannot import celery tasks')