Files
notifications-admin/tests/app/notify_client/test_compliant_client.py
Katie Smith 7a40ad6ac0 Add new methods to Service and Complaint api clients
* Added a new method to the ComplaintApiClient to get the total
complaints by date range from the API.
* Added a new method to the ServiceAPIClient to get the new platform
admin stats data from the API.
2018-06-29 15:31:40 +01:00

20 lines
615 B
Python

from app import ComplaintApiClient
def test_get_all_complaints(mocker):
client = ComplaintApiClient()
mock = mocker.patch('app.notify_client.complaint_api_client.ComplaintApiClient.get')
client.get_all_complaints()
mock.assert_called_once_with('/complaint')
def test_get_complaint_count(mocker):
client = ComplaintApiClient()
mock = mocker.patch.object(client, 'get')
params_dict = {'start_date': '2018-06-01', 'end_date': '2018-06-15'}
client.get_complaint_count(params_dict=params_dict)
mock.assert_called_once_with('/complaint/count-by-date-range', params=params_dict)