From 4d06ec8e6202ac398af735dbf9b6bc89f2d66c00 Mon Sep 17 00:00:00 2001
From: Paul McCarthy <pauldmccarthy@gmail.com>
Date: Wed, 8 May 2019 10:46:26 +0100
Subject: [PATCH] TEST: Extra test for resample_image script

---
 tests/test_scripts/test_resample_image.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/tests/test_scripts/test_resample_image.py b/tests/test_scripts/test_resample_image.py
index 3477c1a23..7fc0cf976 100644
--- a/tests/test_scripts/test_resample_image.py
+++ b/tests/test_scripts/test_resample_image.py
@@ -3,6 +3,8 @@
 
 import numpy as np
 
+import pytest
+
 import fsl.scripts.resample_image as resample_image
 
 
@@ -67,3 +69,13 @@ def test_resample_image_ref():
         assert np.all(np.isclose(res.shape, (20, 20, 20)))
         assert np.all(np.isclose(res.pixdim, (0.5, 0.5, 0.5)))
         assert np.all(np.isclose(res.voxToWorldMat, expv2w))
+
+
+def test_resample_image_bad_options():
+    with tempdir():
+        img = Image(make_random_image('image.nii.gz', dims=(10, 10, 10)))
+
+        with pytest.raises(SystemExit) as e:
+            resample_image.main('image resampled -d 0.5 0.5 0.5 '
+                                '-s 20 20 20'.split())
+        assert e.value.code != 0
-- 
GitLab