From 6797bffe445bff5f10626fa72c163beca229ac91 Mon Sep 17 00:00:00 2001 From: Paul McCarthy <pauldmccarthy@gmail.com> Date: Sun, 21 Jan 2018 16:39:00 +0000 Subject: [PATCH] Silly test for silly function --- tests/test_fsl_utils_path.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/test_fsl_utils_path.py b/tests/test_fsl_utils_path.py index fe1380a99..9a567396f 100644 --- a/tests/test_fsl_utils_path.py +++ b/tests/test_fsl_utils_path.py @@ -110,6 +110,20 @@ def test_shallowest(): assert fslpath.shallowest(path, suffixes) == output +def test_hasExt(): + + tests = [ + ('file.nii', ['.nii', '.gz'], True), + ('file.nii.gz', ['.nii'], False), + ('file.nii.gz', ['.nii', '.gz'], True), + ('file.nii.gz', ['.nii.gz'], True), + ('file.txt', ['.nii', '.gz'], False), + ] + + for path, aexts, expected in tests: + assert fslpath.hasExt(path, aexts) == expected + + def test_addExt_imageFiles_mustExist_shouldPass(): """Tests the addExt function where the path exists, and the inputs are valid. -- GitLab