From 703387790055234321fb4180424799df57d4b654 Mon Sep 17 00:00:00 2001 From: James Kent Date: Mon, 22 Jan 2024 13:19:08 -0600 Subject: [PATCH] fix cli and add test --- compose_runner/cli.py | 2 +- compose_runner/tests/test_cli.py | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 compose_runner/tests/test_cli.py diff --git a/compose_runner/cli.py b/compose_runner/cli.py index 8d73ecd..27f99d5 100644 --- a/compose_runner/cli.py +++ b/compose_runner/cli.py @@ -16,7 +16,7 @@ @click.option("nsc_key", "--nsc-key", help="Neurosynth Compose api key.") @click.option("nv_key", "--nv-key", help="Neurovault api key.") @click.option("--no-upload", is_flag=True, help="Do not upload results.") -@click.option("--n-cores", help="Number of cores to use for parallelization.") +@click.option("--n-cores", type=int, help="Number of cores to use for parallelization.") def cli(meta_analysis_id, environment, result_dir, nsc_key, nv_key, no_upload, n_cores): """Execute and upload a meta-analysis workflow. diff --git a/compose_runner/tests/test_cli.py b/compose_runner/tests/test_cli.py new file mode 100644 index 0000000..09749e6 --- /dev/null +++ b/compose_runner/tests/test_cli.py @@ -0,0 +1,13 @@ +from click.testing import CliRunner + +from compose_runner.cli import cli + + +def test_cli(): + runner = CliRunner() + result = runner.invoke(cli, [ + "4nBwrGsqVWtt", + '--environment', "staging", + "--n-cores", 1, + "--no-upload"]) + assert result.exit_code == 0