Exemplo n.º 1
0
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()
Exemplo n.º 2
0
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()
Exemplo n.º 3
0
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'))
Exemplo n.º 4
0
# -*- 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()
Exemplo n.º 5
0
def serve_test():
    web.init()
    return web.app.test_client()
Exemplo n.º 6
0
def serve():
    web.init()
    web.app.run(web.app.config.get('HOST'), web.app.config.get('PORT'))
Exemplo n.º 7
0
def serve_test():
    web.init()
    return web.app.test_client()
Exemplo n.º 8
0
def serve():
    web.init()
    web.app.run(web.app.config.get('HOST'), web.app.config.get('PORT'))
Exemplo n.º 9
0
def serve():
    web.init()
    web.app.run(web.app.config.get("HOST"), web.app.config.get("PORT"))
Exemplo n.º 10
0
# 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'))
Exemplo n.º 11
0
def serve():
    web.init()
    web.app.run(web.app.config.get("HOST"), web.app.config.get("PORT"))