From 3cd8618b6a79427f78a1efbc29f7133198673435 Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Mon, 19 Mar 2018 21:44:21 -0400 Subject: [PATCH] TEST: Check get_zooms units arg in MINC/ECAT --- nibabel/tests/test_ecat.py | 4 ++++ nibabel/tests/test_minc1.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/nibabel/tests/test_ecat.py b/nibabel/tests/test_ecat.py index a346c71569..180b7c83b5 100644 --- a/nibabel/tests/test_ecat.py +++ b/nibabel/tests/test_ecat.py @@ -169,6 +169,10 @@ def test_subheader(self): np.array([2.20241979, 2.20241979, 3.125, 1.])) assert self.subhdr.get_zooms()[0] == 2.20241978764534 assert self.subhdr.get_zooms()[2] == 3.125 + assert_array_equal(self.subhdr.get_zooms(units='raw'), + self.subhdr.get_zooms(units='norm')) + with pytest.raises(ValueError): + self.subhdr.get_zooms(units='badarg') assert self.subhdr._get_data_dtype(0) == np.int16 #assert_equal(self.subhdr._get_frame_offset(), 1024) assert self.subhdr._get_frame_offset() == 1536 diff --git a/nibabel/tests/test_minc1.py b/nibabel/tests/test_minc1.py index a908ee6ad9..3bdcc3d026 100644 --- a/nibabel/tests/test_minc1.py +++ b/nibabel/tests/test_minc1.py @@ -131,6 +131,10 @@ def test_mincfile(self): assert mnc.get_data_dtype().type == tp['dtype'] assert mnc.get_data_shape() == tp['shape'] assert mnc.get_zooms() == tp['zooms'] + assert mnc.get_zooms(units='raw') == tp['zooms'] + assert mnc.get_zooms(units='norm') == tp['zooms'] + with pytest.raises(ValueError): + mnc.get_zooms(units='badarg') assert_array_equal(mnc.get_affine(), tp['affine']) data = mnc.get_scaled_data() assert data.shape == tp['shape']