Skip to content

Commit

Permalink
try to add test case to reproduce
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyCBakerPhD authored Feb 15, 2024
1 parent 3b91993 commit 6850d6e
Showing 1 changed file with 49 additions and 1 deletion.
50 changes: 49 additions & 1 deletion tests/test_inspector.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ def setUpClass(cls):
@classmethod
def tearDownClass(cls):
rmtree(cls.tempdir)

def test_inspect_nwbfile_dandi_config_critical_only_entire_registry(self):
test_results = list(
inspect_nwbfile(
Expand Down Expand Up @@ -656,6 +656,54 @@ def test_inspect_nwbfile_dandi_config_violation_and_above_entire_registry(self):
]
self.assertCountEqual(first=test_results, second=true_results)

def inspect_all_dandi_config_parallel(self):

test_results = list(inspect_all(path=Path(self.nwbfile_paths[0]).parent, config=load_config(filepath_or_keyword="dandi"), n_jobs=2))

expected_results = [
InspectorMessage(
message="Subject is missing.",
importance=Importance.CRITICAL,
check_function_name="check_subject_exists",
object_type="NWBFile",
object_name="root",
location="/",
file_path=self.nwbfile_paths[0],
),
InspectorMessage(
message="The length of the first dimension of data (4) does not match the length of timestamps (3).",
importance=Importance.CRITICAL,
check_function_name="check_timestamps_match_first_dimension",
object_type="TimeSeries",
object_name="test_time_series_3",
location="/acquisition/test_time_series_3",
file_path=self.nwbfile_paths[0],
),
InspectorMessage(
message="Subject is missing.",
importance=Importance.CRITICAL,
check_function_name="check_subject_exists",
object_type="NWBFile",
object_name="root",
location="/",
file_path=self.nwbfile_paths[1],
),
InspectorMessage(
message=(
"Data may be in the wrong orientation. Time should be in the first dimension, "
"and is usually the longest dimension. Here, another dimension is longer."
),
importance=Importance.BEST_PRACTICE_VIOLATION,
severity=Severity.LOW,
check_function_name="check_data_orientation",
object_type="TimeSeries",
object_name="my_spatial_series",
location="/acquisition/my_spatial_series",
file_path=self.nwbfile_paths[1],
),
]
self.assertCountEqual(first=test_results, second=true_results)


class TestCheckUniqueIdentifiersPass(TestCase):
maxDiff = None
Expand Down

0 comments on commit 6850d6e

Please sign in to comment.