From 3d253facc744486c58beb2a2b65720ba07072cdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20tom=20W=C3=B6rden?= <h.tomwoerden@indiscale.com> Date: Mon, 20 Feb 2023 14:31:26 +0100 Subject: [PATCH] TST: fix unittest --- README-SETUP.md => README_SETUP.md | 0 integrationtests/test-profile/profile.yml | 4 ---- src/bids-cfood/cfood.yml | 14 ++++++++++---- .../{ => json_only}/dataset_description.json | 0 unittests/test_dataset_description.py | 6 +++--- 5 files changed, 13 insertions(+), 11 deletions(-) rename README-SETUP.md => README_SETUP.md (100%) rename unittests/test_data/{ => json_only}/dataset_description.json (100%) diff --git a/README-SETUP.md b/README_SETUP.md similarity index 100% rename from README-SETUP.md rename to README_SETUP.md diff --git a/integrationtests/test-profile/profile.yml b/integrationtests/test-profile/profile.yml index 953f6ad..3bde561 100644 --- a/integrationtests/test-profile/profile.yml +++ b/integrationtests/test-profile/profile.yml @@ -21,11 +21,7 @@ default: # extroot: From where files are copied/symlinked. This is a # list of `NAME: PATH` pairs or a single path. extroot: - # "": "paths/extroot" "": "../../bids-examples/" - #"valid_dataset": "../../unittests/test_data/valid_dataset/" - #"SFB1193C04": "../../unittests/test_data/SFB1193C04/" - #"valid_dataset": "../../unittests/test_data/SFB1193C04/" # # "base": "/path/to/base/dir" # "other": "/path/to/other" diff --git a/src/bids-cfood/cfood.yml b/src/bids-cfood/cfood.yml index 1d3eda6..d5abf87 100644 --- a/src/bids-cfood/cfood.yml +++ b/src/bids-cfood/cfood.yml @@ -215,6 +215,9 @@ Converters: BIDSDirectory: package: bidsconverter.bids_dir_converter converter: BIDSDirConverter + BIDSSubjectDirectory: + package: bidsconverter.bids_dir_converter + converter: BIDSSubjectDirConverter BIDSEEGDirectory: package: bidsconverter.bids_dir_converter converter: BIDSEEGDirConverter @@ -233,9 +236,12 @@ Converters: BIDSDataset: package: bidsconverter.bids_dir_converter converter: BIDSDatasetConverter - BIDSSubjectDirectory: + BIDSPETDirectory: package: bidsconverter.bids_dir_converter - converter: BIDSSubjectDirConverter + converter: BIDSPETDirConverter + BIDSDWIDirectory: + package: bidsconverter.bids_dir_converter + converter: BIDSDWIDirConverter project_level: type: BIDSDataset match: ^(?P<name>.*)$ @@ -556,7 +562,7 @@ project_level: - suffix: "phasediff" parent: "PhaseDifference" pet: - type: BIDSDirectory + type: BIDSPETDirectory match: ^(?P<datatype>pet)$ subtree: series_list: @@ -578,7 +584,7 @@ project_level: - suffix: "stim" parent: "ContinuousRecording" dwi: - type: BIDSDirectory + type: BIDSDWIDirectory match: ^(?P<datatype>dwi)$ subtree: series_list: diff --git a/unittests/test_data/dataset_description.json b/unittests/test_data/json_only/dataset_description.json similarity index 100% rename from unittests/test_data/dataset_description.json rename to unittests/test_data/json_only/dataset_description.json diff --git a/unittests/test_dataset_description.py b/unittests/test_dataset_description.py index 7e861a5..d7e26d2 100644 --- a/unittests/test_dataset_description.py +++ b/unittests/test_dataset_description.py @@ -58,10 +58,10 @@ def test_dataset(): # print("DictIntegerElement" in converter_registry) records = crawler.start_crawling( - Directory('test_data', rfp("test_data")), + Directory('json_only', rfp("test_data/json_only")), crawler_definition, converter_registry, - restricted_path=['test_data', 'dataset_description.json'] + restricted_path=["json_only", 'dataset_description.json'] ) subd = crawler.debug_tree subc = crawler.debug_metadata @@ -86,7 +86,7 @@ def test_dataset(): assert len(dataset.get_property("Author").value) == 2 persons = [el for el in dataset.get_property("Author").value if isinstance(el, db.Entity)] assert len(persons) == 2 - assert "Paul Broca" in [el.name for el in persons] + assert "Paul Broca" in [el.get_property("lastName").value for el in persons] assert "Carl" in [el.get_property("firstname").value for el in persons if el.get_property("firstname") is not None] funding = [el for el in dataset.get_property("Funding").value if isinstance(el, db.Entity)] -- GitLab