Skip to content

Commit 5c82c6d

Browse files
committed
enh: improve regression test
1 parent 9cb2961 commit 5c82c6d

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

heudiconv/tests/test_regression.py

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -103,26 +103,22 @@ def test_grouping(tmpdir, subject):
103103

104104
template = op.join("{subject}/*.dcm")
105105
hargs = gen_heudiconv_args(
106-
tmpdir.strpath, outdir.strpath, subject, 'convertall.py',
106+
tmpdir.strpath,
107+
outdir.strpath,
108+
subject,
109+
'convertall.py',
107110
template=template
108111
)
109112

110113
with pytest.raises(AssertionError):
111-
"""
112-
test_regression.py:110: in test_grouping
113-
runner(hargs)
114-
../cli/run.py:128: in main
115-
process_args(args)
116-
../cli/run.py:333: in process_args
117-
dcmconfig=args.dcmconfig,)
118-
../convert.py:168: in prep_conversion
119-
grouping=None)
120-
../dicoms.py:96: in group_dicoms_into_seqinfos
121-
studyUID, file_studyUID
122-
E AssertionError: Conflicting study identifiers found [1.3.12.2.1107.5.2.32.35131.30000014022817282751500000052, 1.3.12.2.1107.5.2.43.66112.30000016081515591223100000010].
123-
"""
124114
runner(hargs)
125115

126116
# group all found DICOMs under subject, despite conflicts
127117
hargs += ["-g", "all"]
128118
runner(hargs)
119+
assert len([fl for fl in outdir.visit(fil='run0*')]) == 4
120+
tsv = (outdir / 'participants.tsv')
121+
assert tsv.check()
122+
lines = tsv.open().readlines()
123+
assert len(lines) == 2
124+
assert lines[1].split('\t')[0] == 'sub-{}'.format(subject)

0 commit comments

Comments
 (0)