@@ -337,48 +337,48 @@ def test_multiple_rule_types_cause_correct_status(faker: Faker):
337337 ("test_comment" , "rule1" , "rule2" , "expected_status" ),
338338 [
339339 (
340- "two rules, both exclude, same priority, should exclude" ,
341- rule_builder .PersonAgeSuppressionRuleFactory .build (priority = rules_model .RulePriority (5 )),
342- rule_builder .PostcodeSuppressionRuleFactory .build (priority = rules_model .RulePriority (5 )),
343- Status .not_actionable ,
340+ "two rules, both exclude, same priority, should exclude" ,
341+ rule_builder .PersonAgeSuppressionRuleFactory .build (priority = rules_model .RulePriority (5 )),
342+ rule_builder .PostcodeSuppressionRuleFactory .build (priority = rules_model .RulePriority (5 )),
343+ Status .not_actionable ,
344344 ),
345345 (
346- "two rules, rule 1 excludes, same priority, should allow" ,
347- rule_builder .PersonAgeSuppressionRuleFactory .build (priority = rules_model .RulePriority (5 )),
348- rule_builder .PostcodeSuppressionRuleFactory .build (
349- priority = rules_model .RulePriority (5 ), comparator = rules_model .RuleComparator ("NW1" )
350- ),
351- Status .actionable ,
346+ "two rules, rule 1 excludes, same priority, should allow" ,
347+ rule_builder .PersonAgeSuppressionRuleFactory .build (priority = rules_model .RulePriority (5 )),
348+ rule_builder .PostcodeSuppressionRuleFactory .build (
349+ priority = rules_model .RulePriority (5 ), comparator = rules_model .RuleComparator ("NW1" )
350+ ),
351+ Status .actionable ,
352352 ),
353353 (
354- "two rules, rule 2 excludes, same priority, should allow" ,
355- rule_builder .PersonAgeSuppressionRuleFactory .build (
356- priority = rules_model .RulePriority (5 ), comparator = rules_model .RuleComparator ("-65" )
357- ),
358- rule_builder .PostcodeSuppressionRuleFactory .build (priority = rules_model .RulePriority (5 )),
359- Status .actionable ,
354+ "two rules, rule 2 excludes, same priority, should allow" ,
355+ rule_builder .PersonAgeSuppressionRuleFactory .build (
356+ priority = rules_model .RulePriority (5 ), comparator = rules_model .RuleComparator ("-65" )
357+ ),
358+ rule_builder .PostcodeSuppressionRuleFactory .build (priority = rules_model .RulePriority (5 )),
359+ Status .actionable ,
360360 ),
361361 (
362- "two rules, rule 1 excludes, different priority, should exclude" ,
363- rule_builder .PersonAgeSuppressionRuleFactory .build (priority = rules_model .RulePriority (5 )),
364- rule_builder .PostcodeSuppressionRuleFactory .build (
365- priority = rules_model .RulePriority (10 ), comparator = rules_model .RuleComparator ("NW1" )
366- ),
367- Status .not_actionable ,
362+ "two rules, rule 1 excludes, different priority, should exclude" ,
363+ rule_builder .PersonAgeSuppressionRuleFactory .build (priority = rules_model .RulePriority (5 )),
364+ rule_builder .PostcodeSuppressionRuleFactory .build (
365+ priority = rules_model .RulePriority (10 ), comparator = rules_model .RuleComparator ("NW1" )
366+ ),
367+ Status .not_actionable ,
368368 ),
369369 (
370- "two rules, rule 2 excludes, different priority, should exclude" ,
371- rule_builder .PersonAgeSuppressionRuleFactory .build (
372- priority = rules_model .RulePriority (5 ), comparator = rules_model .RuleComparator ("-65" )
373- ),
374- rule_builder .PostcodeSuppressionRuleFactory .build (priority = rules_model .RulePriority (10 )),
375- Status .not_actionable ,
370+ "two rules, rule 2 excludes, different priority, should exclude" ,
371+ rule_builder .PersonAgeSuppressionRuleFactory .build (
372+ priority = rules_model .RulePriority (5 ), comparator = rules_model .RuleComparator ("-65" )
373+ ),
374+ rule_builder .PostcodeSuppressionRuleFactory .build (priority = rules_model .RulePriority (10 )),
375+ Status .not_actionable ,
376376 ),
377377 (
378- "two rules, both excludes, different priority, should exclude" ,
379- rule_builder .PersonAgeSuppressionRuleFactory .build (priority = rules_model .RulePriority (5 )),
380- rule_builder .PostcodeSuppressionRuleFactory .build (priority = rules_model .RulePriority (10 )),
381- Status .not_actionable ,
378+ "two rules, both excludes, different priority, should exclude" ,
379+ rule_builder .PersonAgeSuppressionRuleFactory .build (priority = rules_model .RulePriority (5 )),
380+ rule_builder .PostcodeSuppressionRuleFactory .build (priority = rules_model .RulePriority (10 )),
381+ Status .not_actionable ,
382382 ),
383383 ],
384384)
@@ -525,46 +525,46 @@ def test_multiple_conditions_where_all_give_unique_statuses(faker: Faker):
525525 ("test_comment" , "campaign1" , "campaign2" ),
526526 [
527527 (
528- "1st campaign allows, 2nd excludes" ,
529- rule_builder .CampaignConfigFactory .build (
530- target = "RSV" ,
531- iterations = [
532- rule_builder .IterationFactory .build (
533- iteration_cohorts = [rule_builder .IterationCohortFactory .build (cohort_label = "cohort1" )],
534- iteration_rules = [rule_builder .PersonAgeSuppressionRuleFactory .build ()],
535- )
536- ],
537- ),
538- rule_builder .CampaignConfigFactory .build (
539- target = "RSV" ,
540- iterations = [
541- rule_builder .IterationFactory .build (
542- iteration_cohorts = [rule_builder .IterationCohortFactory .build (cohort_label = "cohort1" )],
543- iteration_rules = [rule_builder .PersonAgeSuppressionRuleFactory .build (comparator = "-85" )],
544- )
545- ],
546- ),
528+ "1st campaign allows, 2nd excludes" ,
529+ rule_builder .CampaignConfigFactory .build (
530+ target = "RSV" ,
531+ iterations = [
532+ rule_builder .IterationFactory .build (
533+ iteration_cohorts = [rule_builder .IterationCohortFactory .build (cohort_label = "cohort1" )],
534+ iteration_rules = [rule_builder .PersonAgeSuppressionRuleFactory .build ()],
535+ )
536+ ],
537+ ),
538+ rule_builder .CampaignConfigFactory .build (
539+ target = "RSV" ,
540+ iterations = [
541+ rule_builder .IterationFactory .build (
542+ iteration_cohorts = [rule_builder .IterationCohortFactory .build (cohort_label = "cohort1" )],
543+ iteration_rules = [rule_builder .PersonAgeSuppressionRuleFactory .build (comparator = "-85" )],
544+ )
545+ ],
546+ ),
547547 ),
548548 (
549- "1st campaign excludes, 2nd allows" ,
550- rule_builder .CampaignConfigFactory .build (
551- target = "RSV" ,
552- iterations = [
553- rule_builder .IterationFactory .build (
554- iteration_cohorts = [rule_builder .IterationCohortFactory .build (cohort_label = "cohort1" )],
555- iteration_rules = [rule_builder .PersonAgeSuppressionRuleFactory .build (comparator = "-85" )],
556- )
557- ],
558- ),
559- rule_builder .CampaignConfigFactory .build (
560- target = "RSV" ,
561- iterations = [
562- rule_builder .IterationFactory .build (
563- iteration_cohorts = [rule_builder .IterationCohortFactory .build (cohort_label = "cohort1" )],
564- iteration_rules = [rule_builder .PersonAgeSuppressionRuleFactory .build ()],
565- )
566- ],
567- ),
549+ "1st campaign excludes, 2nd allows" ,
550+ rule_builder .CampaignConfigFactory .build (
551+ target = "RSV" ,
552+ iterations = [
553+ rule_builder .IterationFactory .build (
554+ iteration_cohorts = [rule_builder .IterationCohortFactory .build (cohort_label = "cohort1" )],
555+ iteration_rules = [rule_builder .PersonAgeSuppressionRuleFactory .build (comparator = "-85" )],
556+ )
557+ ],
558+ ),
559+ rule_builder .CampaignConfigFactory .build (
560+ target = "RSV" ,
561+ iterations = [
562+ rule_builder .IterationFactory .build (
563+ iteration_cohorts = [rule_builder .IterationCohortFactory .build (cohort_label = "cohort1" )],
564+ iteration_rules = [rule_builder .PersonAgeSuppressionRuleFactory .build ()],
565+ )
566+ ],
567+ ),
568568 ),
569569 ],
570570)
@@ -815,7 +815,7 @@ def test_status_if_iteration_rules_contains_cohort_label_field(
815815
816816
817817@pytest .mark .parametrize (
818- "rule_stop, expected_status, test_comment" ,
818+ ( "rule_stop" , " expected_status" , " test_comment") ,
819819 [
820820 ("Y" , Status .not_actionable , "Stops at the first rule" ),
821821 ("N" , Status .not_eligible , "Both the rules are executed" ),
@@ -824,7 +824,6 @@ def test_status_if_iteration_rules_contains_cohort_label_field(
824824 ],
825825)
826826def test_rules_stop_behavior (rule_stop : str | None , expected_status : Status , test_comment : str , faker : Faker ) -> None :
827-
828827 # Given
829828 nhs_number = NHSNumber (faker .nhs_number ())
830829 date_of_birth = DateOfBirth (faker .date_of_birth (minimum_age = 18 , maximum_age = 74 ))
0 commit comments