@@ -56,32 +56,21 @@ def test_handle_creates_all_reports(self, dataframe, csv_data, now):
5656
5757 mock_read_sql , mock_blob_storage , mock_email_service = md
5858
59- assert mock_read_sql .call_count == 3
60- assert mock_blob_storage .add .call_count == 3
59+ assert mock_read_sql .call_count == 2
60+ assert mock_blob_storage .add .call_count == 2
6161 assert mock_email_service .send_reports_email .call_count == 1
6262
6363 for bso_code in Command .BSO_CODES :
64- mock_read_sql .assert_any_call (
65- Helper .sql ("aggregate" ), connection , params = ["3 months" , bso_code ]
66- )
6764 mock_read_sql .assert_any_call (
6865 Helper .sql ("failures" ), connection , params = [now .date (), bso_code ]
6966 )
7067 mock_read_sql .assert_any_call (
71- Helper .sql ("reconciliation" ), connection , params = [now . date () , bso_code ]
68+ Helper .sql ("reconciliation" ), connection , params = ["3 months" , bso_code ]
7269 )
7370
74- aggregate_filename = (
75- f"{ now .strftime ('%Y-%m-%dT%H:%M:%S' )} -{ bso_code } -aggregate-report.csv"
76- )
7771 failures_filename = f"{ now .strftime ('%Y-%m-%dT%H:%M:%S' )} -{ bso_code } -invites-not-sent-report.csv"
7872 reconciliation_filename = f"{ now .strftime ('%Y-%m-%dT%H:%M:%S' )} -{ bso_code } -reconciliation-report.csv"
7973
80- mock_blob_storage .add .assert_any_call (
81- aggregate_filename ,
82- csv_data ,
83- content_type = "text/csv" ,
84- )
8574 mock_blob_storage .add .assert_any_call (
8675 failures_filename ,
8776 csv_data ,
@@ -95,7 +84,6 @@ def test_handle_creates_all_reports(self, dataframe, csv_data, now):
9584
9685 mock_email_service .send_reports_email .assert_called_once_with (
9786 {
98- aggregate_filename : csv_data ,
9987 failures_filename : csv_data ,
10088 reconciliation_filename : csv_data ,
10189 }
@@ -142,7 +130,7 @@ def test_smoke_test_argument_uses_correct_configuration(
142130 mock_read_sql , mock_blob_storage , mock_email_service = md
143131
144132 mock_read_sql .assert_called_once_with (
145- Helper .sql ("reconciliation" ), connection , params = [now . date () , "SM0K3" ]
133+ Helper .sql ("reconciliation" ), connection , params = ["1 week" , "SM0K3" ]
146134 )
147135 mock_blob_storage .add .assert_called_once_with (
148136 "SM0K3-reconciliation-report.csv" ,
0 commit comments