From 19253e019cf3fa6d831eaf606f3ff1b2cdfd0604 Mon Sep 17 00:00:00 2001 From: bpinsard Date: Thu, 8 Aug 2024 14:30:39 -0400 Subject: [PATCH] add basic tests for create_seqinfo, assert SequenceName not empty --- heudiconv/tests/test_dicoms.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/heudiconv/tests/test_dicoms.py b/heudiconv/tests/test_dicoms.py index 4cb28290..6fef6e6d 100644 --- a/heudiconv/tests/test_dicoms.py +++ b/heudiconv/tests/test_dicoms.py @@ -17,6 +17,8 @@ get_reproducible_int, group_dicoms_into_seqinfos, parse_private_csa_header, + create_seqinfo, + dw, ) from .utils import TESTS_DATA_PATH @@ -178,6 +180,23 @@ def test_get_datetime_from_dcm_wo_dt() -> None: assert get_datetime_from_dcm(XA30_enhanced_dcm) is None +dicom_test_data = [ + (dw.wrapper_from_file(d_file), [d_file], op.basename(d_file)) + for d_file in glob( op.join(TESTS_DATA_PATH, "*.dcm")) +] + + +@pytest.mark.parametrize("mw,series_files,series_id", dicom_test_data) +def test_create_seqinfo( + mw: dw.Wrapper, + series_files: list[str], + series_id: str, +) -> None: + seqinfo = create_seqinfo(mw, series_files, series_id) + assert(seqinfo.sequence_name != "") + pass + + def test_get_reproducible_int() -> None: dcmfile = op.join(TESTS_DATA_PATH, "phantom.dcm")