Skip to content
This repository has been archived by the owner on Jul 7, 2022. It is now read-only.

Commit

Permalink
Merge pull request #20 from AusDTO/enhancement/find-applications-method
Browse files Browse the repository at this point in the history
find applications
  • Loading branch information
djrobstep committed Nov 11, 2016
2 parents 5f85469 + aa06b54 commit 909e513
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dmapiclient/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,10 @@ def get_application(self, application_id):
return self._get(
"/applications/{}".format(application_id))

def find_applications(self):
return self._get(
"/applications")

def update_application(self, applicationId, application):
return self._patch(
"/applications/{}".format(applicationId),
Expand Down
16 changes: 16 additions & 0 deletions tests/test_apiclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -1996,6 +1996,22 @@ def test_get_application(self, data_client, rmock):

assert result == {"application": "result"}

def test_find_applications(self, data_client, rmock):
rmock.get(
"http://baseurl/applications",
json={"applications": [{
"user_id": 2,
"foo": "bar"
}]},
status_code=200)

result = data_client.find_applications()

assert result == {"applications": [{
"user_id": 2,
"foo": "bar"
}]}

def test_update_application(self, data_client, rmock):
rmock.patch(
"http://baseurl/applications/1",
Expand Down

0 comments on commit 909e513

Please sign in to comment.