Skip to content

Commit

Permalink
Added a test for the dict version of window_size
Browse files Browse the repository at this point in the history
  • Loading branch information
jonbrenas committed Oct 19, 2024
1 parent 8d2b4c2 commit 4fb0ba1
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/anoph/test_h12.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,29 @@ def test_h12_gwss_multi_with_default_analysis(fixture, api: AnophelesH12Analysis
check_h12_gwss_multi(api=api, h12_params=h12_params)


@parametrize_with_cases("fixture,api", cases=".")
def test_h12_gwss_multi_with_window_size_dict(fixture, api: AnophelesH12Analysis):
# Set up test parameters.
all_sample_sets = api.sample_sets()["sample_set"].to_list()
all_countries = api.sample_metadata()["country"].unique().tolist()
country1, country2 = random.sample(all_countries, 2)
cohort1_query = f"country == '{country1}'"
cohort2_query = f"country == '{country2}'"
h12_params = dict(
contig=random.choice(api.contigs),
sample_sets=all_sample_sets,
window_size={
"cohort1": random.randint(100, 500),
"cohort2": random.randint(100, 500),
},
min_cohort_size=1,
cohorts={"cohort1": cohort1_query, "cohort2": cohort2_query},
)

# Run checks.
check_h12_gwss_multi(api=api, h12_params=h12_params)


@parametrize_with_cases("fixture,api", cases=".")
def test_h12_gwss_multi_with_analysis(fixture, api: AnophelesH12Analysis):
# Set up test parameters.
Expand Down

0 comments on commit 4fb0ba1

Please sign in to comment.