mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-31 23:26:23 -05:00
Simplify failure rate by building separate query
This commit is contained in:
@@ -79,12 +79,6 @@ def test_format_statistics(stats, email_counts, sms_counts, letter_counts):
|
||||
StatsRow('sms', 'permanent-failure', 100),
|
||||
StatsRow('sms', 'delivered', 300),
|
||||
], 0.25),
|
||||
'ignores_other_notification_types': ([
|
||||
StatsRow('sms', 'permanent-failure', 100),
|
||||
StatsRow('sms', 'delivered', 300),
|
||||
StatsRow('email', 'delivered', 300),
|
||||
StatsRow('letter', 'created', 300),
|
||||
], 0.25),
|
||||
'only_counts_permanent_failure_as_failed': ([
|
||||
StatsRow('sms', 'permanent-failure', 100),
|
||||
StatsRow('sms', 'temporary-failure', 100),
|
||||
|
||||
@@ -45,6 +45,5 @@ def test_get_services_with_high_failure_rates(notify_db_session):
|
||||
|
||||
assert get_services_with_high_failure_rates(start_date, end_date, threshold=3) == [{
|
||||
'id': str(service_1.id),
|
||||
'name': service_1.name,
|
||||
'permanent_failure_rate': 0.25
|
||||
}]
|
||||
|
||||
Reference in New Issue
Block a user