From 5ff34ad8053a5c9ef43a32814d1bf944fee2d164 Mon Sep 17 00:00:00 2001 From: "zaman.afzal" Date: Tue, 30 Apr 2024 02:41:47 -0700 Subject: [PATCH] feat: added enterprise access public api --- swagger/api.yaml | 4 ++++ tests/test_all.yaml | 1 + tests/test_enterprise_access.yaml | 22 ++++++++++++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 tests/test_enterprise_access.yaml diff --git a/swagger/api.yaml b/swagger/api.yaml index 172679c..b83be0d 100644 --- a/swagger/api.yaml +++ b/swagger/api.yaml @@ -36,6 +36,10 @@ paths: "/catalog/v1/catalogs/{id}/courses": $ref: "https://raw.githubusercontent.com/edx/course-discovery/b5c52c8/api.yaml#/endpoints/v1/catalogCourses" + # Enterprise Access IDA + "/enterprise-access/v1/assignment-configurations/{assignment_configuration_uuid}/admin/assignments/cancel/": + $ref: "https://raw.githubusercontent.com/openedx/enterprise-access/31185ee/api.yaml#/endpoints/v1/learnerContentAssignmentCancelRequest" + # Enterprise IDA "/enterprise/v1/enterprise-catalogs": $ref: "https://raw.githubusercontent.com/edx/edx-enterprise/260055b/api.yaml#/endpoints/v1/enterpriseCustomerCatalogs" diff --git a/tests/test_all.yaml b/tests/test_all.yaml index e26fb50..43929f0 100644 --- a/tests/test_all.yaml +++ b/tests/test_all.yaml @@ -4,3 +4,4 @@ - import: 'tests/test_oauth.yaml' - import: 'tests/test_catalog.yaml' - import: 'tests/test_enterprise.yaml' +- import: 'tests/test_enterprise_access.yaml' diff --git a/tests/test_enterprise_access.yaml b/tests/test_enterprise_access.yaml new file mode 100644 index 0000000..30bda0e --- /dev/null +++ b/tests/test_enterprise_access.yaml @@ -0,0 +1,22 @@ +--- +- config: + - testset: 'Enterprise Access API' + +- test: + - name: 'Assignment configuration cancel endpoint returns HTTP 200' + - url: '/enterprise-access/v1/assignment-configurations/9101d3de36156cba/admin/assignments/cancel/' + - method: 'POST' + - headers: { 'Authorization': 'aeiou', 'Content-Type': 'application/json' } + - body: > + [ + { + "assignment_uuids": ["01234567-89ab-cdef-0123-456789abcdef", "abcdef01-2345-6789-abcd-ef0123456789"] + } + ] + - expected_status: [200] + +- test: + - name: 'GET rejected without authorization' + - url: '/enterprise-access/v1/assignment-configurations/0123456789abcdefg/admin/assignments/cancel/' + - method: 'POST' + - expected_status: [400] \ No newline at end of file