@@ -33,7 +33,9 @@ def test_campaigns_grouped_by_condition_name_filters_correctly( # noqa: PLR0913
3333):
3434 campaign = rule .CampaignConfigFactory .build (target = campaign_target , type = campaign_type )
3535
36- result = campaign_evaluator .get_campaign_with_latest_active_iteration_per_target ([campaign ], conditions_filter , category_filter )
36+ result = campaign_evaluator .get_campaign_with_latest_active_iteration_per_target (
37+ [campaign ], conditions_filter , category_filter
38+ )
3739 assert_that ([(str (name ), group [0 ].type ) for name , group in result ], is_ (expected_result ))
3840
3941
@@ -47,7 +49,9 @@ def test_campaigns_grouped_by_condition_name_with_no_active_campaigns(campaign_e
4749 target = "RSV" , type = "V" , start_date = datetime .date (2025 , 4 , 20 ), end_date = datetime .date (2025 , 4 , 21 )
4850 )
4951
50- result = campaign_evaluator .get_campaign_with_latest_active_iteration_per_target ([campaign ], ["RSV" ], "VACCINATIONS" )
52+ result = campaign_evaluator .get_campaign_with_latest_active_iteration_per_target (
53+ [campaign ], ["RSV" ], "VACCINATIONS"
54+ )
5155 assert_that (list (result ), is_ ([]))
5256
5357
@@ -63,7 +67,9 @@ def test_campaigns_grouped_by_condition_name_with_various_categories(
6367 campaign_evaluator , category_filter , campaign_type , expected_count
6468):
6569 campaign = rule .CampaignConfigFactory .build (target = "COVID" , type = campaign_type )
66- result = list (campaign_evaluator .get_campaign_with_latest_active_iteration_per_target ([campaign ], ["COVID" ], category_filter ))
70+ result = list (
71+ campaign_evaluator .get_campaign_with_latest_active_iteration_per_target ([campaign ], ["COVID" ], category_filter )
72+ )
6773 assert_that (len (result ), is_ (expected_count ))
6874 if expected_count > 0 :
6975 assert_that (str (result [0 ][0 ]), is_ ("COVID" ))
@@ -84,7 +90,11 @@ def test_campaigns_grouped_by_condition_name_groups_multiple_campaigns_for_same_
8490 )
8591
8692 all_campaigns = [campaign1 , campaign2 , campaign3 , inactive_campaign ]
87- result = list (campaign_evaluator .get_campaign_with_latest_active_iteration_per_target (all_campaigns , ["COVID" , "FLU" ], "VACCINATIONS" ))
93+ result = list (
94+ campaign_evaluator .get_campaign_with_latest_active_iteration_per_target (
95+ all_campaigns , ["COVID" , "FLU" ], "VACCINATIONS"
96+ )
97+ )
8898
8999 assert_that (len (result ), is_ (2 ))
90100
@@ -105,13 +115,17 @@ def test_campaign_grouping_is_affected_by_order_for_mixed_types(campaign_evaluat
105115
106116 evaluator_s_first = campaign_evaluator
107117 result_s_first = list (
108- evaluator_s_first .get_campaign_with_latest_active_iteration_per_target ([campaign_s , campaign_v ], ["RSV" ], "VACCINATIONS" )
118+ evaluator_s_first .get_campaign_with_latest_active_iteration_per_target (
119+ [campaign_s , campaign_v ], ["RSV" ], "VACCINATIONS"
120+ )
109121 )
110122 assert_that (result_s_first , is_ ([]))
111123
112124 evaluator_v_first = campaign_evaluator
113125 result_v_first = list (
114- evaluator_v_first .get_campaign_with_latest_active_iteration_per_target ([campaign_v , campaign_s ], ["RSV" ], "VACCINATIONS" )
126+ evaluator_v_first .get_campaign_with_latest_active_iteration_per_target (
127+ [campaign_v , campaign_s ], ["RSV" ], "VACCINATIONS"
128+ )
115129 )
116130 assert_that (len (result_v_first ), is_ (1 ))
117131 assert_that (len (result_v_first [0 ][1 ]), is_ (2 ))
0 commit comments