def setUp(self): """Define test variables and initialize app.""" self.app = get_app(load_config()) self.client = self.app.test_client self.observations_post_data = { 'cd_nom': 3582, 'obs_txt': 'Tada', 'count': 1, 'geometry': {"type": "Point", "coordinates": [5, 45]} }
def setUp(self): """Define test variables and initialize app.""" self.app = get_app(load_config()) self.client = self.app.test_client self.observations_post_data = { "cd_nom": 3582, "obs_txt": "Tada", "count": 1, "geometry": { "type": "Point", "coordinates": [5, 45] }, }
""" Give a unique entry point for gunicorn """ import os if "gunicorn" in os.environ.get("SERVER_SOFTWARE", ""): import gevent.monkey gevent.monkey.patch_all() from server import get_app # noqa: F401 from gncitizen.utils.env import load_config, get_config_file_path # noqa: F401 # get the app config file config = load_config() # give the app context from server.py in a app object app = get_app(config) port = app.config["API_PORT"] if app.config.get("API_PORT", False) else 5002 if __name__ == "__main__": app.run( host="0.0.0.0", port=port, extra_files=get_config_file_path(), processes=3, )
import json import requests from gncitizen.utils.env import load_config # disable loud logs from urllib3 import logging logging.getLogger("urllib3").setLevel(logging.WARNING) APP_CONF = load_config() access_token = None refresh_token = None mainUrl = "http://*****:*****@test.com" """\ INSERT INTO gnc_core.t_users ( id_user, name, surname, username, password, email, phone,