From 6b36275dd0c57e998305c02b07cff339868568bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Haitz=20Legarreta=20Gorro=C3=B1o?= Date: Sun, 22 Dec 2024 19:21:14 -0500 Subject: [PATCH] ENH: Test scripts can be called with the help flag Test scripts can be called with the help flag. --- pyproject.toml | 1 + test/test_dwi_gp_estimation_error_analysis.py | 27 +++++++++++++++++++ ...t_dwi_gp_estimation_error_analysis_plot.py | 27 +++++++++++++++++++ test/test_dwi_gp_estimation_signal_plot.py | 27 +++++++++++++++++++ ...test_dwi_gp_estimation_simulated_signal.py | 27 +++++++++++++++++++ test/test_optimize_registration.py | 27 +++++++++++++++++++ 6 files changed, 136 insertions(+) create mode 100644 test/test_dwi_gp_estimation_error_analysis.py create mode 100644 test/test_dwi_gp_estimation_error_analysis_plot.py create mode 100644 test/test_dwi_gp_estimation_signal_plot.py create mode 100644 test/test_dwi_gp_estimation_simulated_signal.py create mode 100644 test/test_optimize_registration.py diff --git a/pyproject.toml b/pyproject.toml index d36f6df..1226eb1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -69,6 +69,7 @@ resmon = ["psutil >=5.4"] test = [ "coverage", "pytest >= 4.4", + "pytest-console-scripts", "pytest-cov", "pytest-env", "pytest-xdist >= 1.28" diff --git a/test/test_dwi_gp_estimation_error_analysis.py b/test/test_dwi_gp_estimation_error_analysis.py new file mode 100644 index 0000000..8a140d1 --- /dev/null +++ b/test/test_dwi_gp_estimation_error_analysis.py @@ -0,0 +1,27 @@ +# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- +# vi: set ft=python sts=4 ts=4 sw=4 et: +# +# Copyright The NiPreps Developers +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# We support and encourage derived works from this project, please read +# about our expectations at +# +# https://www.nipreps.org/community/licensing/ +# + + +def test_help_option(script_runner): + ret = script_runner.run("dwi_gp_estimation_error_analysis.py", "--help") + assert ret.success diff --git a/test/test_dwi_gp_estimation_error_analysis_plot.py b/test/test_dwi_gp_estimation_error_analysis_plot.py new file mode 100644 index 0000000..332173a --- /dev/null +++ b/test/test_dwi_gp_estimation_error_analysis_plot.py @@ -0,0 +1,27 @@ +# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- +# vi: set ft=python sts=4 ts=4 sw=4 et: +# +# Copyright The NiPreps Developers +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# We support and encourage derived works from this project, please read +# about our expectations at +# +# https://www.nipreps.org/community/licensing/ +# + + +def test_help_option(script_runner): + ret = script_runner.run("dwi_gp_estimation_error_analysis_plot.py", "--help") + assert ret.success diff --git a/test/test_dwi_gp_estimation_signal_plot.py b/test/test_dwi_gp_estimation_signal_plot.py new file mode 100644 index 0000000..7fd25e9 --- /dev/null +++ b/test/test_dwi_gp_estimation_signal_plot.py @@ -0,0 +1,27 @@ +# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- +# vi: set ft=python sts=4 ts=4 sw=4 et: +# +# Copyright The NiPreps Developers +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# We support and encourage derived works from this project, please read +# about our expectations at +# +# https://www.nipreps.org/community/licensing/ +# + + +def test_help_option(script_runner): + ret = script_runner.run("dwi_gp_estimation_signal_plot.py", "--help") + assert ret.success diff --git a/test/test_dwi_gp_estimation_simulated_signal.py b/test/test_dwi_gp_estimation_simulated_signal.py new file mode 100644 index 0000000..179ab32 --- /dev/null +++ b/test/test_dwi_gp_estimation_simulated_signal.py @@ -0,0 +1,27 @@ +# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- +# vi: set ft=python sts=4 ts=4 sw=4 et: +# +# Copyright The NiPreps Developers +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# We support and encourage derived works from this project, please read +# about our expectations at +# +# https://www.nipreps.org/community/licensing/ +# + + +def test_help_option(script_runner): + ret = script_runner.run("dwi_gp_estimation_simulated_signal.py", "--help") + assert ret.success diff --git a/test/test_optimize_registration.py b/test/test_optimize_registration.py new file mode 100644 index 0000000..ad79085 --- /dev/null +++ b/test/test_optimize_registration.py @@ -0,0 +1,27 @@ +# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- +# vi: set ft=python sts=4 ts=4 sw=4 et: +# +# Copyright The NiPreps Developers +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# We support and encourage derived works from this project, please read +# about our expectations at +# +# https://www.nipreps.org/community/licensing/ +# + + +def test_help_option(script_runner): + ret = script_runner.run("optimize_registration.py", "--help") + assert ret.success