def setUp(self): if os.environ.get('TEST_POSIX_PROVIDER'): user_data = None else: with open(util.get_test_data_path('test_users.yaml')) as f: user_data = yaml.load(f) self.app = create_app(user_data=user_data, settings={ 'signature_key': _SIGNATURE_KEY, 'database_url': 'sqlite://', 'admin_role': os.environ.get('TEST_ADMIN_ROLE', 'pteroadmin'), }) self.app.config['TESTING'] = True self.client = self.app.test_client() self.public_key = rsa_key.AUTH_PUBLIC_KEY
from ptero_auth.api.application import create_app from ptero_auth.settings import get_from_env app = create_app(get_from_env())
from ptero_auth.api.application import create_app import argparse import logging import os def parse_args(): parser = argparse.ArgumentParser() parser.add_argument('--log-level', default='INFO', help='Logging level') return parser.parse_args() if __name__ == '__main__': args = parse_args() logging.basicConfig(level=getattr(logging, args.log_level.upper())) from ptero_auth.settings import get_from_env app = create_app(get_from_env()) app.run(port=settings.port(), host='0.0.0.0')