Skip to content

Commit 5b30d5b

Browse files
committed
rf: clean up test
1 parent 98e93a4 commit 5b30d5b

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

nipype/interfaces/tests/test_extra_dcm2nii.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,19 @@ def fetch_data(datadir, dicoms):
2525
@pytest.mark.skipif(no_dcm2niix, reason="Dcm2niix required")
2626
def test_dcm2niix_dwi(tmpdir):
2727
tmpdir.chdir()
28-
datadir = tmpdir / 'data'
29-
datadir.mkdir()
28+
datadir = tmpdir.mkdir('data').strpath
3029
try:
31-
dicoms = fetch_data(datadir.strpath, 'Siemens_Sag_DTI_20160825_145811')
30+
dicoms = fetch_data(datadir, 'Siemens_Sag_DTI_20160825_145811')
3231
except IncompleteResultsError as exc:
3332
pytest.skip("Failed to fetch test data: %s" % str(exc))
3433

35-
def assert_dwi(eg, bids):
34+
def assert_dwi(eg):
3635
"Some assertions we will make"
3736
assert eg.outputs.converted_files
3837
assert eg.outputs.bvals
3938
assert eg.outputs.bvecs
4039
outputs = [y for x,y in eg.outputs.get().items()]
41-
if bids:
40+
if eg.inputs.get('bids_format'):
4241
# ensure all outputs are of equal lengths
4342
assert len(set(map(len, outputs))) == 1
4443
else:
@@ -47,10 +46,10 @@ def assert_dwi(eg, bids):
4746
dcm = Dcm2niix()
4847
dcm.inputs.source_dir = dicoms
4948
dcm.inputs.out_filename = '%u%z'
50-
assert_dwi(dcm.run(), True)
49+
assert_dwi(dcm.run())
5150

5251
# now run specifying output directory and removing BIDS option
5352
outdir = tmpdir.mkdir('conversion').strpath
5453
dcm.inputs.output_dir = outdir
5554
dcm.inputs.bids_format = False
56-
assert_dwi(dcm.run(), False)
55+
assert_dwi(dcm.run())

0 commit comments

Comments
 (0)