Skip to content

Commit

Permalink
test: generalise cli test for easier maintainance (#403)
Browse files Browse the repository at this point in the history
  • Loading branch information
d0choa authored Jan 12, 2024
1 parent c6ca806 commit 4bf1aa5
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,7 @@
def test_main_no_step() -> None:
"""Test the main function of the CLI without a valid step."""
override_key = "step"
available_steps = [
"colocalisation",
"eqtl_catalogue",
"finngen_studies",
"finngen_sumstat_preprocess",
"gene_index",
"gwas_catalog_ingestion",
"gwas_catalog_study_curation",
"gwas_catalog_study_inclusion",
"gwas_catalog_sumstat_preprocess",
"ld_based_clumping",
"ld_index",
"locus_to_gene",
"overlaps",
"pics",
"ukbiobank",
"variant_annotation",
"variant_index",
"variant_to_gene",
"window_based_clumping",
]
opts = "\n\t".join(available_steps)
expected = f"You must specify '{override_key}', e.g, {override_key}=<OPTION>\nAvailable options:\n\t{opts}"
expected = f"You must specify '{override_key}', e.g, {override_key}=<OPTION>\nAvailable options:"

with patch("sys.argv", ["cli.py"]), pytest.raises(
ConfigCompositionException, match=expected
Expand Down

0 comments on commit 4bf1aa5

Please sign in to comment.