mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 16:24:08 -04:00
Add PlatformStatsAPIClient
In API, the endpoint for the new platform admin stats page has been moved to a platform stats blueprint. This means we now need a platform stats client.
This commit is contained in:
10
tests/app/notify_client/test_platform_stats_api_client.py
Normal file
10
tests/app/notify_client/test_platform_stats_api_client.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from app.notify_client.platform_stats_api_client import PlatformStatsAPIClient
|
||||
|
||||
|
||||
def test_get_aggregate_platform_stats(mocker):
|
||||
client = PlatformStatsAPIClient()
|
||||
mock = mocker.patch.object(client, 'get')
|
||||
params_dict = {'start_date': '2018-06-01', 'end_date': '2018-06-15'}
|
||||
|
||||
client.get_aggregate_platform_stats(params_dict=params_dict)
|
||||
mock.assert_called_once_with('/platform-stats', params=params_dict)
|
||||
@@ -53,15 +53,6 @@ def test_client_only_updates_allowed_attributes(mocker):
|
||||
assert str(error.value) == 'Not allowed to update service attributes: foo'
|
||||
|
||||
|
||||
def test_get_new_aggregate_platform_stats(mocker):
|
||||
client = ServiceAPIClient()
|
||||
mock = mocker.patch.object(client, 'get')
|
||||
params_dict = {'start_date': '2018-06-01', 'end_date': '2018-06-15'}
|
||||
|
||||
client.get_new_aggregate_platform_stats(params_dict=params_dict)
|
||||
mock.assert_called_once_with('/service/platform-stats-new', params=params_dict)
|
||||
|
||||
|
||||
def test_client_creates_service_with_correct_data(
|
||||
mocker,
|
||||
active_user_with_permissions,
|
||||
|
||||
Reference in New Issue
Block a user