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