mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 15:57:23 -04:00
[WIP]
New service_api_client to get stats for variable days
This commit is contained in:
@@ -35,15 +35,24 @@ def test_client_gets_service(mocker):
|
||||
mock_get.assert_called_once_with('/service/foo')
|
||||
|
||||
|
||||
@pytest.mark.parametrize('today_only', [True, False])
|
||||
def test_client_gets_service_statistics(mocker, today_only):
|
||||
def test_client_gets_service_statistics(mocker):
|
||||
client = ServiceAPIClient()
|
||||
mock_get = mocker.patch.object(client, 'get', return_value={'data': {'a': 'b'}})
|
||||
|
||||
ret = client.get_service_statistics('foo', today_only)
|
||||
ret = client.get_service_statistics('foo')
|
||||
|
||||
assert ret == {'a': 'b'}
|
||||
mock_get.assert_called_once_with('/service/foo/statistics', params={'today_only': today_only})
|
||||
mock_get.assert_called_once_with('/service/foo/statistics')
|
||||
|
||||
|
||||
def test_client_gets_service_statistics_for_today(mocker):
|
||||
client = ServiceAPIClient()
|
||||
mock_get = mocker.patch.object(client, 'get', return_value={'data': {'a': 'b'}})
|
||||
|
||||
ret = client.get_service_statistics_for_today('foo')
|
||||
|
||||
assert ret == {'a': 'b'}
|
||||
mock_get.assert_called_once_with('/service/foo/statistics', params={'today_only': True})
|
||||
|
||||
|
||||
def test_client_only_updates_allowed_attributes(mocker):
|
||||
|
||||
Reference in New Issue
Block a user