mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-05 08:31:00 -04:00
Use arguments rather than passing around a dict
This makes it harder to write code which will pass tests but fail in real life.
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
from datetime import date
|
||||
|
||||
from app.notify_client.performance_dashboard_api_client import (
|
||||
PerformanceDashboardAPIClient,
|
||||
)
|
||||
@@ -6,7 +8,13 @@ from app.notify_client.performance_dashboard_api_client import (
|
||||
def test_get_aggregate_platform_stats(mocker):
|
||||
client = PerformanceDashboardAPIClient()
|
||||
mock = mocker.patch.object(client, 'get')
|
||||
params_dict = {'start_date': '2021-03-01', 'end_date': '2021-03-31'}
|
||||
|
||||
client.get_performance_dashboard_stats(params_dict=params_dict)
|
||||
mock.assert_called_once_with('/performance-dashboard', params=params_dict)
|
||||
client.get_performance_dashboard_stats(
|
||||
start_date=date(2021, 3, 1),
|
||||
end_date=date(2021, 3, 31),
|
||||
)
|
||||
|
||||
mock.assert_called_once_with('/performance-dashboard', params={
|
||||
'start_date': '2021-03-01',
|
||||
'end_date': '2021-03-31'
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user