From c1fa3a45bef32c92d5f0875845097b59ad089406 Mon Sep 17 00:00:00 2001 From: Christopher Chaaya Date: Tue, 19 Dec 2017 17:10:12 +1100 Subject: [PATCH 1/2] Fix 'projects[]' parameter in project.py get_bids function. --- freelancersdk/resources/projects/projects.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/freelancersdk/resources/projects/projects.py b/freelancersdk/resources/projects/projects.py index 0fcc2ed..afd3b68 100644 --- a/freelancersdk/resources/projects/projects.py +++ b/freelancersdk/resources/projects/projects.py @@ -212,7 +212,7 @@ def get_bids(session, project_ids=[], bid_ids=[], limit=10, offset=0): if bid_ids: get_bids_data['bids[]'] = bid_ids if project_ids: - get_bids_data['project_ids[]'] = project_ids + get_bids_data['projects[]'] = project_ids get_bids_data['limit'] = limit get_bids_data['offset'] = offset # GET /api/projects/0.1/bids/ From 56f9fa7e68cd56d634a5fdb4f20f08dbabeee806 Mon Sep 17 00:00:00 2001 From: Christopher Chaaya Date: Wed, 20 Dec 2017 10:38:15 +1100 Subject: [PATCH 2/2] Modify get_bids test to check that the call was made correctly (with the correct parameters). --- tests/test_projects.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/test_projects.py b/tests/test_projects.py index 176625b..84a76ce 100644 --- a/tests/test_projects.py +++ b/tests/test_projects.py @@ -502,9 +502,10 @@ def test_get_bids(self): j = get_bids(self.session, **get_bids_data) get_bids_data.update({'projects[]': get_bids_data['project_ids']}) del(get_bids_data['project_ids']) - self.assertTrue(self.session.session.get.called) - self.assertTrue(self.session.session.get.call_args[1]['params']['offset'], 10) - self.assertTrue(self.session.session.get.call_args[1]['params']['offset'], 20) + self.session.session.get.assert_called_once_with( + 'https://fake-fln.com/api/projects/0.1/bids/', + params=get_bids_data, + verify=True) self.assertEquals(len(j['bids']), 5) def test_award_project_bid(self):