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.
This commit is contained in:
Katie Smith
2018-06-21 15:04:03 +01:00
parent aba9cf0ff3
commit 7a40ad6ac0
4 changed files with 24 additions and 0 deletions

View File

@@ -8,3 +8,12 @@ def test_get_all_complaints(mocker):
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)