From 07d2227c3f8eda7cdabf88b1177bab21f49aa232 Mon Sep 17 00:00:00 2001 From: Addison Elliott Date: Sun, 27 Jan 2019 00:38:21 -0600 Subject: [PATCH] Resolve tests --- nrrd/tests/test_writing.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/nrrd/tests/test_writing.py b/nrrd/tests/test_writing.py index 161c23a..c05187b 100644 --- a/nrrd/tests/test_writing.py +++ b/nrrd/tests/test_writing.py @@ -184,21 +184,23 @@ def test_write_fake_encoding(self): def test_write_detached_raw(self): output_filename = os.path.join(self.temp_write_dir, 'testfile_detached_raw.nhdr') - output_data_filename = os.path.join(self.temp_write_dir, 'testfile_detached_raw.raw') + # Data & header are still detached even though detached_header is False because the filename is .nhdr + # Test also checks detached data filename that it is relative (default value) nrrd.write(output_filename, self.data_input, {u'encoding': 'raw'}, detached_header=False) # Read back the same file data, header = nrrd.read(output_filename) self.assertEqual(self.expected_data, data.tostring(order='F')) self.assertEqual(header['encoding'], 'raw') - self.assertEqual(header['data file'], output_data_filename) + self.assertEqual(header['data file'], 'testfile_detached_raw.raw') def test_write_detached_gz(self): output_filename = os.path.join(self.temp_write_dir, 'testfile_detached_raw.nhdr') output_data_filename = os.path.join(self.temp_write_dir, 'testfile_detached_raw.raw.gz') # Data & header are still detached even though detached_header is False because the filename is .nhdr + # Test also checks detached data filename that it is absolute nrrd.write(output_filename, self.data_input, {u'encoding': 'gz'}, detached_header=False, relative_data_path=False) @@ -212,6 +214,7 @@ def test_write_detached_bz2(self): output_filename = os.path.join(self.temp_write_dir, 'testfile_detached_raw.nhdr') # Data & header are still detached even though detached_header is False because the filename is .nhdr + # Test also checks detached data filename that it is relative (default value) nrrd.write(output_filename, self.data_input, {u'encoding': 'bz2'}, detached_header=False) # Read back the same file @@ -224,6 +227,7 @@ def test_write_detached_ascii(self): output_filename = os.path.join(self.temp_write_dir, 'testfile_detached_raw.nhdr') # Data & header are still detached even though detached_header is False because the filename is .nhdr + # Test also checks detached data filename that it is relative (default value) nrrd.write(output_filename, self.data_input, {u'encoding': 'txt'}, detached_header=False) # Read back the same file