def _prepare(self): try: from web_gui import config except ImportError: from web_gui import default_config as config from dataflow.cache import set_test_cache from dataflow import fetch set_test_cache() fetch.DATA_SOURCES = config.data_sources Environment._prepared = True
def regression_test(): """Regressions tests from tests/regression_files, suitable for nosetests""" set_test_cache() fetch.DATA_SOURCES = config.data_sources path = abspath(joinpath(dirname(__file__), 'regression_files')) data_files = [ p for f in listdir(path) for p in [joinpath(path, f)] if isfile(p) ] for file in data_files: test = lambda: regression.replay_file(file) test.description = "Regression test on %s" % file yield test
def regression_test(): """Regressions tests from tests/regression_files, suitable for nosetests""" set_test_cache() load.DATA_SOURCES = config.data_sources path = abspath(joinpath(dirname(__file__), 'regression_files')) data_files = [p for f in listdir(path) for p in [joinpath(path, f)] if isfile(p)] for file in data_files: test = lambda: regression.replay_file(file) test.description = "Regression test on %s"%file yield test
def setup_fetch(): #from web_gui import default_config from dataflow.cache import set_test_cache from dataflow import fetch set_test_cache() fetch.DATA_SOURCES = [ { "name": "file", "url": "file:///", "start_path": "", }, { "name": "https", "url": "https://", "start_path": "", }, { "name": "http", "url": "http://", "start_path": "", }, { "name": "nice", "url": "file:///", "start_path": "usr/local/nice/server_data/experiments", }, { "name": "DOI", "DOI": "10.18434/T4201B", }, { "name": "ncnr", "url": "http://ncnr.nist.gov/pub/", "start_path": "", }, { "name": "charlotte", "url": "http://charlotte.ncnr.nist.gov/pub", "start_path": "", }, ]
def main(): # type: (str) -> None """ Run a regression test using the first command line as the target file. """ set_test_cache() fetch.DATA_SOURCES = config.data_sources if len(sys.argv) < 2: print("usage: python regression.py datafile") sys.exit() try: if sys.argv[1].endswith('.json'): play_file(sys.argv[1]) else: replay_file(sys.argv[1]) sys.exit(0) except Exception as exc: traceback.print_exc() sys.exit(1)