Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update allocate assignment endpoint schema #299

Merged
merged 1 commit into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions swagger/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,11 @@ paths:
# Enterprise Access IDA
# These are served from the enterprise-access IDA, but we surface them with the rest of the enterprise endpoints
"/enterprise/v1/assignment-configurations/{assignment_configuration_uuid}/admin/assignments/cancel/":
$ref: "https://raw.githubusercontent.com/openedx/enterprise-access/747d8b9/api.yaml#/endpoints/v1/learnerContentAssignmentCancelRequest"
$ref: "https://raw.githubusercontent.com/openedx/enterprise-access/8975f08/api.yaml#/endpoints/v1/learnerContentAssignmentCancelRequest"
"/enterprise/v1/assignment-configurations/{assignment_configuration_uuid}/admin/assignments/remind/":
$ref: "https://raw.githubusercontent.com/openedx/enterprise-access/747d8b9/api.yaml#/endpoints/v1/learnerContentAssignmentRemindRequest"
$ref: "https://raw.githubusercontent.com/openedx/enterprise-access/8975f08/api.yaml#/endpoints/v1/learnerContentAssignmentRemindRequest"
"/enterprise/v1/policy-allocation/{policy_uuid}/allocate/":
$ref: "https://raw.githubusercontent.com/openedx/enterprise-access/8975f08/api.yaml#/endpoints/v1/subsidyAccessPolicyAllocation"
# Enterprise Catalog IDA
# These are served from the enterprise catalog IDA, but we surface them with the rest of the enterprise endpoints
"/enterprise/v2/enterprise-catalogs":
Expand Down
25 changes: 23 additions & 2 deletions tests/test_enterprise_access.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,27 @@
- config:
- testset: 'Enterprise Access API'

- test:
- name: 'Policy Allocation endpoint returns HTTP 200'
- url: '/enterprise/v1/policy-allocation/9101d3de36156cba/allocate?content_key=edx+DemoX&content_price_cents=55&learner_emails=["abc@example.com"]'
- method: 'POST'
- headers: { 'Authorization': 'aeiou', 'Content-Type': 'application/json' }
- expected_status: [200]

- test:
- name: 'Policy Allocation endpoint rejected without Authorization'
- url: '/enterprise/v1/policy-allocation/9101d3de36156cba/allocate?content_key=edx+DemoX&content_price_cents=55&learner_emails=["abc@example.com"]'
- method: 'POST'
- expected_status: [400]

- test:
- name: 'Policy Allocation endpoint returns HTTP 400 when required query param is missing'
- url: '/enterprise/v1/policy-allocation/9101d3de36156cba/allocate'
- method: 'POST'
- headers: { 'Authorization': 'aeiou', 'Content-Type': 'application/json' }
- expected_status: [400]


- test:
- name: 'Assignment configuration cancel endpoint returns HTTP 200'
- url: '/enterprise/v1/assignment-configurations/9101d3de36156cba/admin/assignments/cancel/'
Expand All @@ -16,7 +37,7 @@
- expected_status: [200]

- test:
- name: 'GET rejected without authorization'
- name: 'POST rejected without authorization'
- url: '/enterprise/v1/assignment-configurations/0123456789abcdefg/admin/assignments/cancel/'
- method: 'POST'
- expected_status: [400]
Expand All @@ -35,7 +56,7 @@
- expected_status: [200]

- test:
- name: 'GET rejected without authorization'
- name: 'POST rejected without authorization'
- url: '/enterprise/v1/assignment-configurations/0123456789abcdefg/admin/assignments/remind/'
- method: 'POST'
- expected_status: [400]
Expand Down