From 6677c5a48f4ec2551f90a94304bf1cbae346eca1 Mon Sep 17 00:00:00 2001 From: Alexander Schlemmer <alexander@mail-schlemmer.de> Date: Thu, 6 Jul 2023 10:18:17 +0200 Subject: [PATCH] STY: autopep8 on test_scanner --- unittests/test_scanner.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/unittests/test_scanner.py b/unittests/test_scanner.py index 52aa18f4..6aa7287b 100644 --- a/unittests/test_scanner.py +++ b/unittests/test_scanner.py @@ -35,15 +35,15 @@ from utils import dircheckstr as dircheck_base UNITTESTDIR = Path(__file__).parent -dircheckstr = partial(dircheck_base, UNITTESTDIR/"test_directories" / "examples_article") +dircheckstr = partial(dircheck_base, UNITTESTDIR / "test_directories" / "examples_article") def test_scan_structure_elements(): tmpfi = NamedTemporaryFile(delete=False) - with open(UNITTESTDIR/"example_datastructure.yml", "r") as f: + with open(UNITTESTDIR / "example_datastructure.yml", "r") as f: data = yaml.load(f, Loader=yaml.SafeLoader) - crawler_definition = load_definition(UNITTESTDIR/"example_cfood.yml") + crawler_definition = load_definition(UNITTESTDIR / "example_cfood.yml") converter_registry = create_converter_registry(crawler_definition) recs = scan_structure_elements(DictElement(name="", value=data), crawler_definition, converter_registry) @@ -54,10 +54,10 @@ def test_provenance_debug_data(): # TODO rewrite the test to use a smaller example setup tmpfi = NamedTemporaryFile(delete=False) debug_tree = DebugTree() - with open(UNITTESTDIR/"example_datastructure.yml", "r") as f: + with open(UNITTESTDIR / "example_datastructure.yml", "r") as f: data = yaml.load(f, Loader=yaml.SafeLoader) - crawler_definition = load_definition(UNITTESTDIR/"example_cfood.yml") + crawler_definition = load_definition(UNITTESTDIR / "example_cfood.yml") converter_registry = create_converter_registry(crawler_definition) stuff = scan_structure_elements(DictElement(name="", value=data), crawler_definition, converter_registry, debug_tree=debug_tree) @@ -83,8 +83,8 @@ def test_record_structure_generation(): # TODO test creation of debug information in a separate test dbt = DebugTree() - scan_directory(UNITTESTDIR/"test_directories" / "examples_article", - UNITTESTDIR/"scifolder_cfood.yml", + scan_directory(UNITTESTDIR / "test_directories" / "examples_article", + UNITTESTDIR / "scifolder_cfood.yml", debug_tree=dbt) subd = dbt.debug_tree[dircheckstr("DataAnalysis")] subc = dbt.debug_metadata["copied"][dircheckstr("DataAnalysis")] @@ -174,13 +174,13 @@ def test_record_generation(): Test the correct list of returned records by the scanner using the scifolder example from the article. """ - - records = scan_directory(UNITTESTDIR/"test_directories" / "examples_article", - UNITTESTDIR/"scifolder_cfood.yml") + + records = scan_directory(UNITTESTDIR / "test_directories" / "examples_article", + UNITTESTDIR / "scifolder_cfood.yml") def parent_filter(parent_name): return [p for p in records if len(p.parents) == 1 and p.parents[0].name == parent_name] - + def check_properties(records, check_props, check_additional=True): records_found = [0 for r in check_props] for rec in records: -- GitLab