Skip to content

Commit a929fae

Browse files
Merge pull request #105 from NHSDigital/feature/eli-222-magic-cohort-added-test-cases
Added additional test case.
2 parents 6da40a3 + 28f8d36 commit a929fae

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

tests/unit/services/calculators/test_eligibility_calculator.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,25 +47,28 @@ def test_not_base_eligible(faker: Faker):
4747

4848

4949
@pytest.mark.parametrize(
50-
("cohorts", "test_comment"),
50+
("person_cohorts", "iteration_cohorts", "test_comment"),
5151
[
52-
(["elid_all_people"], "Only magic cohort present"),
53-
(["elid_all_people", "cohort1"], "Magic cohort with other cohorts"),
52+
(["cohort1"], ["elid_all_people"], "Only magic cohort present"),
53+
(["cohort1"], ["elid_all_people", "cohort1"], "Magic cohort with other cohorts"),
54+
([], ["elid_all_people"], "Only magic cohort present without "),
5455
],
5556
)
56-
def test_base_eligible_with_when_magic_cohort_is_present(faker: Faker, cohorts, test_comment):
57+
def test_base_eligible_with_when_magic_cohort_is_present(
58+
faker: Faker, person_cohorts: list[str], iteration_cohorts: list[str], test_comment: str
59+
):
5760
# Given
5861
nhs_number = NHSNumber(faker.nhs_number())
5962
date_of_birth = DateOfBirth(faker.date_of_birth(minimum_age=76, maximum_age=79))
6063

61-
person_rows = person_rows_builder(nhs_number, date_of_birth=date_of_birth, cohorts=["cohort1"])
64+
person_rows = person_rows_builder(nhs_number, date_of_birth=date_of_birth, cohorts=person_cohorts)
6265
campaign_configs = [
6366
rule_builder.CampaignConfigFactory.build(
6467
target="RSV",
6568
iterations=[
6669
rule_builder.IterationFactory.build(
6770
iteration_cohorts=[
68-
rule_builder.IterationCohortFactory.build(cohort_label=label) for label in cohorts
71+
rule_builder.IterationCohortFactory.build(cohort_label=label) for label in iteration_cohorts
6972
],
7073
iteration_rules=[rule_builder.PersonAgeSuppressionRuleFactory.build()],
7174
)

0 commit comments

Comments
 (0)