Skip to content

Commit 4b9dbe4

Browse files
author
Shoshana Berleant
committed
fix test oops
1 parent b66db5f commit 4b9dbe4

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

nipype/algorithms/tests/test_tsnr.py

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@ class TestTSNR(unittest.TestCase):
2222
'in_file': 'tsnrinfile.nii',
2323
}
2424

25-
out_filenames = {
26-
# default output file names
27-
'detrended_file': '/home/ubuntu/nipype/detrend.nii.gz',
28-
'mean_file': '/home/ubuntu/nipype/mean.nii.gz',
29-
'stddev_file': '/home/ubuntu/nipype/stdev.nii.gz',
30-
'tsnr_file': '/home/ubuntu/nipype/tsnr.nii.gz'
31-
}
25+
out_filenames = {key: os.path.abspath(filename) for key, filename in
26+
{
27+
# default output file names
28+
'detrended_file': 'detrend.nii.gz',
29+
'mean_file': 'mean.nii.gz',
30+
'stddev_file': 'stdev.nii.gz',
31+
'tsnr_file': 'tsnr.nii.gz'
32+
}.items()}
3233

3334
def setUp(self):
3435
# setup
@@ -85,7 +86,7 @@ def test_tsnr_withpoly3(self):
8586
})
8687

8788
def assert_expected_outputs_poly(self, tsnrresult, hash_dict):
88-
assert_equal(tsnrresult.outputs.detrended_file,
89+
assert_equal(os.path.abspath(tsnrresult.outputs.detrended_file),
8990
self.out_filenames['detrended_file'])
9091
self.assert_expected_outputs(tsnrresult, hash_dict)
9192

@@ -94,9 +95,12 @@ def assert_expected_outputs(self, tsnrresult, hash_dict):
9495
self.assert_unchanged(hash_dict)
9596

9697
def assert_default_outputs(self, outputs):
97-
assert_equal(outputs.mean_file, self.out_filenames['mean_file'])
98-
assert_equal(outputs.stddev_file, self.out_filenames['stddev_file'])
99-
assert_equal(outputs.tsnr_file, self.out_filenames['tsnr_file'])
98+
assert_equal(os.path.abspath(outputs.mean_file),
99+
self.out_filenames['mean_file'])
100+
assert_equal(os.path.abspath(outputs.stddev_file),
101+
self.out_filenames['stddev_file'])
102+
assert_equal(os.path.abspath(outputs.tsnr_file),
103+
self.out_filenames['tsnr_file'])
100104

101105
def assert_unchanged(self, expected_hashes):
102106
for key, hexhash in expected_hashes.iteritems():

0 commit comments

Comments
 (0)