From f2b731a0d3e8d509cde164ae93614dbf93ea8d33 Mon Sep 17 00:00:00 2001
From: Paul McCarthy <pauld.mccarthy@gmail.com>
Date: Wed, 8 Mar 2017 22:23:21 +0000
Subject: [PATCH] Some fixes to tests

---
 tests/test_image.py     | 6 +++---
 tests/test_immv_imcp.py | 4 +++-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/tests/test_image.py b/tests/test_image.py
index e771f9636..8f1459c8e 100644
--- a/tests/test_image.py
+++ b/tests/test_image.py
@@ -13,7 +13,7 @@ import glob
 import numpy   as np
 import nibabel as nib
 
-from nibabel.spatialimages import HeaderDataError
+from nibabel.spatialimages import ImageFileError
 
 import fsl.data.constants as constants
 import fsl.data.image     as fslimage
@@ -49,8 +49,8 @@ def test_load(testdir):
     shouldRaise = [('notexist',        fslpath.PathError),
                    ('notexist.nii.gz', fslpath.PathError),
                    ('ambiguous',       fslpath.PathError),
-                   ('notnifti',        HeaderDataError),
-                   ('notnifti.nii.gz', HeaderDataError)]
+                   ('notnifti',        ImageFileError),
+                   ('notnifti.nii.gz', ImageFileError)]
     
     # Not raising an error means the test passes
     for fname in shouldPass:
diff --git a/tests/test_immv_imcp.py b/tests/test_immv_imcp.py
index 414f58c52..8fcb62751 100644
--- a/tests/test_immv_imcp.py
+++ b/tests/test_immv_imcp.py
@@ -16,6 +16,8 @@ import               tempfile
 import numpy   as np
 import nibabel as nib
 
+from nibabel.spatialimages import ImageFileError
+
 import pytest
 
 import fsl.utils.path   as fslpath
@@ -454,7 +456,7 @@ def test_imcp_script_shouldFail(move=False):
                 if move: immv_script.main(imcp_args)
                 else:    imcp_script.main(imcp_args)
                 assert False
-            except (RuntimeError, IOError, fslpath.PathError):
+            except (RuntimeError, IOError, fslpath.PathError, ImageFileError):
                 pass
 
             sp.call('chmod u+rwx {}'.format(indir) .split())
-- 
GitLab