diff --git a/dmapiclient/__init__.py b/dmapiclient/__init__.py index 6ed48dc..bd1ddbe 100644 --- a/dmapiclient/__init__.py +++ b/dmapiclient/__init__.py @@ -1,4 +1,4 @@ -__version__ = '29.8.0' +__version__ = '29.9.0' from .errors import APIError, HTTPError, InvalidResponse # noqa from .errors import REQUEST_ERROR_STATUS_CODE, REQUEST_ERROR_MESSAGE # noqa diff --git a/dmapiclient/data.py b/dmapiclient/data.py index 0c98405..ca43adb 100644 --- a/dmapiclient/data.py +++ b/dmapiclient/data.py @@ -412,8 +412,9 @@ def find_supplier_framework_applications_by_lot( page=None ): return self._get( - f"/frameworks/{framework_slug}/suppliers/applications/{lot_slug}", + f"/frameworks/{framework_slug}/suppliers/applications", params={ + 'lot': lot_slug, 'evaluation_status': evaluation_status, 'section_slug': section_slug, 'evaluator_framework_lot_id': evaluator_framework_lot_id, @@ -427,6 +428,14 @@ def find_supplier_framework_applications_by_lot( ) find_supplier_framework_applications_by_lot_iter.__name__ = str("find_supplier_framework_applications_by_lot_iter") + def verify_supplier_framework_application(self, framework_slug, supplier_id, lot_slug=None): + return self._get( + f"/frameworks/{framework_slug}/suppliers/{supplier_id}/applications/verify", + params={ + 'lot': lot_slug + } + ) + def export_suppliers(self, framework_slug): return self._get( "/suppliers/export/{}".format(framework_slug) diff --git a/tests/test_data_api_client.py b/tests/test_data_api_client.py index 986ce16..dd2174f 100644 --- a/tests/test_data_api_client.py +++ b/tests/test_data_api_client.py @@ -1280,7 +1280,7 @@ def test_find_framework_suppliers_no_lot_responses(self, data_client, rmock): def test_find_supplier_framework_applications_by_lot(self, data_client, rmock): rmock.get( - 'http://baseurl/frameworks/g-cloud-7/suppliers/applications/cloud-sourcing', + 'http://baseurl/frameworks/g-cloud-7/suppliers/applications?lot=cloud-sourcing', json={'supplierFrameworks': [{"supplierId": 1}, {"supplierId": 2}]}, status_code=200) @@ -1291,8 +1291,8 @@ def test_find_supplier_framework_applications_by_lot(self, data_client, rmock): def test_find_supplier_framework_applications_by_lot_with_attributes(self, data_client, rmock): rmock.get( - 'http://baseurl/frameworks/g-cloud-7/suppliers/applications/cloud-sourcing' - '?evaluation_status=not-evaluated§ion_slug=slug-name&evaluator_framework_lot_id=1234', + 'http://baseurl/frameworks/g-cloud-7/suppliers/applications?lot=cloud-sourcing' + '&evaluation_status=not-evaluated§ion_slug=slug-name&evaluator_framework_lot_id=1234', json={'supplierFrameworks': [{"supplierId": 1}, {"supplierId": 2}]}, status_code=200) @@ -1307,6 +1307,28 @@ def test_find_supplier_framework_applications_by_lot_with_attributes(self, data_ assert result == {'supplierFrameworks': [{"supplierId": 1}, {"supplierId": 2}]} assert rmock.called + def test_verify_supplier_framework_application(self, data_client, rmock): + rmock.get( + "http://baseurl/frameworks/g-things-88/suppliers/1234/applications/verify", + json={"applicationStatus": "result"}, + status_code=200) + + result = data_client.verify_supplier_framework_application('g-things-88', 1234) + + assert result == {"applicationStatus": "result"} + assert rmock.called + + def test_verify_supplier_framework_application_with_lot(self, data_client, rmock): + rmock.get( + "http://baseurl/frameworks/g-things-88/suppliers/1234/applications/verify?lot=g-thing", + json={"applicationStatus": "result"}, + status_code=200) + + result = data_client.verify_supplier_framework_application('g-things-88', 1234, 'g-thing') + + assert result == {"applicationStatus": "result"} + assert rmock.called + def test_can_export_suppliers(self, data_client, rmock): rmock.get( "http://baseurl/suppliers/export/g-cloud-9", @@ -3210,10 +3232,10 @@ def test_find_supplier_framework_applications_by_lot_iter(self, data_client, rmo data_client, rmock, method_name='find_supplier_framework_applications_by_lot_iter', model_name='supplierFrameworks', - url_path='frameworks/g-cloud-6/suppliers/applications/g-things', + url_path='frameworks/g-cloud-6/suppliers/applications?lot=g-things', iter_kwargs={ 'framework_slug': 'g-cloud-6', - 'lot_slug': 'g-things' + 'lot_slug': 'g-things', } )