def configure(): """Configure the Flask app. This has to be called just once per test run (not e.g. once for each test). """ os.environ['JOB_CONFIG'] = os.path.join(os.path.dirname(__file__), 'settings_test.py') web.init()
def configure(): """Configure the Flask app. This has to be called just once per test run (not e.g. once for each test). """ os.environ['JOB_CONFIG'] = os.path.join( os.path.dirname(__file__), 'settings_test.py') web.init()
def serve(): web.init() if web.app.config.get('DOCKER'): http_server = HTTPServer(WSGIContainer(web.app)) http_server.listen(web.app.config.get('PORT')) IOLoop.instance().start() else: web.app.run(web.app.config.get('HOST'), web.app.config.get('PORT'))
# -*- coding: utf-8 -*- ''' Test the whole datapusher but mock the CKAN datastore. ''' import os import ckanserviceprovider.web as web os.environ['JOB_CONFIG'] = os.path.join(os.path.dirname(__file__), 'settings_test.py') web.init() import json import unittest import logging import httpretty import pandas import datapusher.main as main import datapusher.jobs as jobs import ckanserviceprovider.util as util from datapusher.geojson2csv import convert from io import StringIO app = main.serve_test() def join_static_path(filename): return os.path.join(os.path.dirname(__file__), 'static', filename) def get_static_file(filename): return open(join_static_path(filename)).read()
def serve_test(): web.init() return web.app.test_client()
def serve(): web.init() web.app.run(web.app.config.get('HOST'), web.app.config.get('PORT'))
def serve(): web.init() web.app.run(web.app.config.get("HOST"), web.app.config.get("PORT"))
# Use this file for development, on a production setup (eg a CKAN production # install) use deployment/datapusher.wsgi import ckanserviceprovider.web as web web.init() import datapusher.jobs as jobs # check whether jobs have been imported properly assert(jobs.push_to_datastore) web.app.run(web.app.config.get('HOST'), web.app.config.get('PORT'))