def serve(): web.configure() web.app.run(web.app.config.get('HOST'), web.app.config.get('PORT'))
def serve_test(): web.configure() return web.app.test_client()
import os import json import unittest import httpretty import ckanserviceprovider.web as web import datapusher.main as main import datapusher.jobs as jobs import ckanserviceprovider.util as util os.environ['JOB_CONFIG'] = os.path.join(os.path.dirname(__file__), 'settings_test.py') web.configure() 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() class TestImport(unittest.TestCase): @classmethod def setup_class(cls): cls.host = 'www.ckan.org'
import json import unittest import datetime from nose.tools import assert_equal, raises import httpretty import ckanserviceprovider.web as web import datapusher.main as main import datapusher.jobs as jobs import ckanserviceprovider.util as util os.environ['JOB_CONFIG'] = os.path.join(os.path.dirname(__file__), 'settings_test.py') web.configure() 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() class TestImport(unittest.TestCase): @classmethod def setup_class(cls): cls.host = 'www.ckan.org'
def serve(): web.configure() web.run()