def test_create_app_with_cf(self): os.environ['VCAP_APPLICATION'] = json.dumps(True) os.environ['VCAP_SERVICES'] = json.dumps(self.vcap_services) test_app = create_app() self.assertEqual(test_app.config['REDIS_HOST'], 'test_host') self.assertEqual(test_app.config['REDIS_PORT'], '1')
def setUp(self): payload = {'user_id': 'test-id', 'aud': 'response_operations_social'} app = create_app('TestingConfig') key = app.config['UAA_PUBLIC_KEY'] self.access_token = jwt.encode(payload, key=key) self.client = app.test_client()
def test_create_app_with_redis(self, _): test_app = create_app() self.assertIn('REDIS_CONNECTION', test_app.config)
def test_create_app_without_redis(self, patched_ping): patched_ping.side_effect = redis.exceptions.ConnectionError test_app = create_app() self.assertNotIn('REDIS_CONNECTION', test_app.config)
def test_create_app(self): test_app = create_app('TestingConfig') self.assertEqual(test_app.config['REDIS_HOST'], 'localhost')
def setUp(self): app = create_app('TestingConfig') self.app = app.test_client()
def setUp(self): self.app = create_app('TestingConfig')
import logging import os from structlog import wrap_logger from response_operations_social_ui import create_app logger = wrap_logger(logging.getLogger(__name__)) if __name__ == '__main__': if not os.getenv('APP_SETTINGS'): os.environ['APP_SETTINGS'] = 'DevelopmentConfig' app = create_app() logger.info("Starting listening on port {}".format(app.config['PORT'])) app.run(debug=app.config['DEBUG'], host='0.0.0.0', port=int(app.config['PORT']))
def setUp(self): app = create_app('TestingConfig') self.client = app.test_client() self.delete_git_info()