Skip to content

Commit

Permalink
add basic tests for create_seqinfo, assert SequenceName not empty
Browse files Browse the repository at this point in the history
  • Loading branch information
bpinsard committed Aug 8, 2024
1 parent cbb9aea commit 19253e0
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions heudiconv/tests/test_dicoms.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
get_reproducible_int,
group_dicoms_into_seqinfos,
parse_private_csa_header,
create_seqinfo,
dw,
)

from .utils import TESTS_DATA_PATH
Expand Down Expand Up @@ -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")

Expand Down

0 comments on commit 19253e0

Please sign in to comment.