def test_nested_without_narrow(run_task): logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.DEBUG) register_all() run_task('s_9_logical_operators', 'nested_without_narrow', 'generic/expected/nested_without_narrow', output_dir=WORKING_PATH)
def test_sequential(run_task): logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.DEBUG) register_all() import examples.s_8_filter_narrow.conf.filters.threshold run_task('s_8_filter_narrow', 'sequential', 'generic/expected', output_dir=WORKING_PATH)
def test_illegal_usage(run_task): logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.DEBUG) register_all() with pytest.raises( ValueError, match="LogicalOperator filter can be used in NestedFilter only"): run_task('s_9_logical_operators', 'illegal_usage', 'generic/expected/illegal_usage', output_dir=WORKING_PATH)
def setup_and_teardown(): shutil.rmtree(WORKING_PATH, ignore_errors=True) register_all() yield shutil.rmtree(WORKING_PATH, ignore_errors=True)
from polytropos.ontology.schema import Schema from polytropos.actions.consume.coverage import CoverageFile from polytropos.ontology.context import Context from polytropos.ontology.task import Task from polytropos.ontology.variable import VariableId from polytropos.tools.schema import treeview from polytropos.tools.schema.catalog import variable_catalog from polytropos.tools.schema.linkage import ExportLinkages from polytropos.tools.schema.repair_sort import repair_sort_order from polytropos.actions import register_all logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) register_all() @click.group() def cli() -> None: """Polytropos. Copyright (c) 2019 Applied Nonprofit Research.""" pass @cli.command() @click.argument('data_path', type=click.Path(exists=True)) @click.argument('config_path', type=click.Path(exists=True)) @click.argument('task_name', type=str) @click.option('--input_path', type=click.Path(exists=True)) @click.option('--output_path', type=click.Path(exists=False)) @click.option('--temp_path', type=click.Path(exists=False))
def test_merge(run_task): logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.DEBUG) register_all() run_task('s_10_merge', 'merge', 'expected', output_dir=WORKING_PATH)