From 829788d0e523d24dcbaaee932e4c80e817e28f89 Mon Sep 17 00:00:00 2001 From: frheault Date: Fri, 11 Oct 2024 11:06:40 -0400 Subject: [PATCH] Fix errors in tests --- requirements.txt | 2 +- scripts/tests/test_labels_from_mask.py | 2 +- scripts/tests/test_volume_stats_in_labels.py | 8 +++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index a9b9d3207..6458a393c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,7 +14,7 @@ docopt==0.6.* dvc==3.48.* dvc-http==2.32.* formulaic==0.3.* -fury==0.10.* +fury==0.11.* future==0.18.* GitPython==3.1.* h5py==3.10.* diff --git a/scripts/tests/test_labels_from_mask.py b/scripts/tests/test_labels_from_mask.py index 335abc195..dc6cb53d7 100644 --- a/scripts/tests/test_labels_from_mask.py +++ b/scripts/tests/test_labels_from_mask.py @@ -8,7 +8,7 @@ from scilpy.io.fetcher import fetch_data, get_testing_files_dict # If they already exist, this only takes 5 seconds (check md5sum) -fetch_data(get_testing_files_dict(), keys=['atlas.zip']) +fetch_data(get_testing_files_dict(), keys=['tractograms.zip']) tmp_dir = tempfile.TemporaryDirectory() diff --git a/scripts/tests/test_volume_stats_in_labels.py b/scripts/tests/test_volume_stats_in_labels.py index 6190f3d46..83bd07b8f 100644 --- a/scripts/tests/test_volume_stats_in_labels.py +++ b/scripts/tests/test_volume_stats_in_labels.py @@ -1,8 +1,13 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- import os +import tempfile from scilpy import SCILPY_HOME +from scilpy.io.fetcher import fetch_data, get_testing_files_dict + +fetch_data(get_testing_files_dict(), keys=['plot.zip']) +tmp_dir = tempfile.TemporaryDirectory() def test_help_option(script_runner): @@ -10,7 +15,8 @@ def test_help_option(script_runner): assert ret.success -def test_execution(script_runner): +def test_execution(script_runner, monkeypatch): + monkeypatch.chdir(os.path.expanduser(tmp_dir.name)) in_map = os.path.join(SCILPY_HOME, 'plot', 'fa.nii.gz') in_atlas = os.path.join(SCILPY_HOME, 'plot', 'atlas_brainnetome.nii.gz') atlas_lut = os.path.join(SCILPY_HOME, 'plot', 'atlas_brainnetome.json')