Skip to content

Commit 810a298

Browse files
author
Félix C. Morency
committed
TEST: Added ECAT7 file writing test
1 parent 6e86e2f commit 810a298

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

nibabel/tests/test_ecat.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#
88
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
99
import os
10+
import tempfile
1011

1112
import numpy as np
1213

@@ -194,9 +195,12 @@ def test_file(self):
194195
self.example_file)
195196
assert_equal(self.img.file_map['image'].filename,
196197
self.example_file)
197-
assert_raises(NotImplementedError,
198-
self.img.to_filename,
199-
'tmp.v')
198+
199+
def test_save(self):
200+
with tempfile.NamedTemporaryFile(suffix='.v') as tmp_file:
201+
self.img.to_filename(tmp_file.name)
202+
other = self.image_class.load(tmp_file.name)
203+
assert_equal(self.img.get_data().all(), other.get_data().all())
200204

201205
def test_data(self):
202206
dat = self.img.get_data()

0 commit comments

Comments
 (0)