edx-enterprise-subsidy-client 0.4.0__tar.gz → 0.4.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {edx-enterprise-subsidy-client-0.4.0 → edx-enterprise-subsidy-client-0.4.2}/CHANGELOG.rst +7 -0
- {edx-enterprise-subsidy-client-0.4.0 → edx-enterprise-subsidy-client-0.4.2}/PKG-INFO +8 -1
- {edx-enterprise-subsidy-client-0.4.0 → edx-enterprise-subsidy-client-0.4.2}/edx_enterprise_subsidy_client/__init__.py +1 -1
- {edx-enterprise-subsidy-client-0.4.0 → edx-enterprise-subsidy-client-0.4.2}/edx_enterprise_subsidy_client.egg-info/PKG-INFO +8 -1
- {edx-enterprise-subsidy-client-0.4.0 → edx-enterprise-subsidy-client-0.4.2}/requirements/constraints.txt +1 -0
- {edx-enterprise-subsidy-client-0.4.0 → edx-enterprise-subsidy-client-0.4.2}/tests/test_client.py +45 -6
- {edx-enterprise-subsidy-client-0.4.0 → edx-enterprise-subsidy-client-0.4.2}/LICENSE +0 -0
- {edx-enterprise-subsidy-client-0.4.0 → edx-enterprise-subsidy-client-0.4.2}/LICENSE.txt +0 -0
- {edx-enterprise-subsidy-client-0.4.0 → edx-enterprise-subsidy-client-0.4.2}/MANIFEST.in +0 -0
- {edx-enterprise-subsidy-client-0.4.0 → edx-enterprise-subsidy-client-0.4.2}/README.rst +0 -0
- {edx-enterprise-subsidy-client-0.4.0 → edx-enterprise-subsidy-client-0.4.2}/edx_enterprise_subsidy_client/client.py +0 -0
- {edx-enterprise-subsidy-client-0.4.0 → edx-enterprise-subsidy-client-0.4.2}/edx_enterprise_subsidy_client.egg-info/SOURCES.txt +0 -0
- {edx-enterprise-subsidy-client-0.4.0 → edx-enterprise-subsidy-client-0.4.2}/edx_enterprise_subsidy_client.egg-info/dependency_links.txt +0 -0
- {edx-enterprise-subsidy-client-0.4.0 → edx-enterprise-subsidy-client-0.4.2}/edx_enterprise_subsidy_client.egg-info/not-zip-safe +0 -0
- {edx-enterprise-subsidy-client-0.4.0 → edx-enterprise-subsidy-client-0.4.2}/edx_enterprise_subsidy_client.egg-info/requires.txt +0 -0
- {edx-enterprise-subsidy-client-0.4.0 → edx-enterprise-subsidy-client-0.4.2}/edx_enterprise_subsidy_client.egg-info/top_level.txt +0 -0
- {edx-enterprise-subsidy-client-0.4.0 → edx-enterprise-subsidy-client-0.4.2}/requirements/base.in +0 -0
- {edx-enterprise-subsidy-client-0.4.0 → edx-enterprise-subsidy-client-0.4.2}/setup.cfg +0 -0
- {edx-enterprise-subsidy-client-0.4.0 → edx-enterprise-subsidy-client-0.4.2}/setup.py +0 -0
|
@@ -14,8 +14,15 @@ Change Log
|
|
|
14
14
|
Unreleased
|
|
15
15
|
**********
|
|
16
16
|
|
|
17
|
+
[0.4.2]
|
|
18
|
+
*******
|
|
17
19
|
* Switch from ``edx-sphinx-theme`` to ``sphinx-book-theme`` since the former is
|
|
18
20
|
deprecated
|
|
21
|
+
* Add python 3.12 support
|
|
22
|
+
|
|
23
|
+
[0.4.1]
|
|
24
|
+
*******
|
|
25
|
+
* chore: add a unit test for ``create_subsidy_transaction()``.
|
|
19
26
|
|
|
20
27
|
[0.4.0]
|
|
21
28
|
*******
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: edx-enterprise-subsidy-client
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.2
|
|
4
4
|
Summary: Client for interacting with the enterprise-subsidy service.
|
|
5
5
|
Home-page: https://github.com/openedx/edx-enterprise-subsidy-client
|
|
6
6
|
Author: edX
|
|
@@ -225,8 +225,15 @@ Change Log
|
|
|
225
225
|
Unreleased
|
|
226
226
|
**********
|
|
227
227
|
|
|
228
|
+
[0.4.2]
|
|
229
|
+
*******
|
|
228
230
|
* Switch from ``edx-sphinx-theme`` to ``sphinx-book-theme`` since the former is
|
|
229
231
|
deprecated
|
|
232
|
+
* Add python 3.12 support
|
|
233
|
+
|
|
234
|
+
[0.4.1]
|
|
235
|
+
*******
|
|
236
|
+
* chore: add a unit test for ``create_subsidy_transaction()``.
|
|
230
237
|
|
|
231
238
|
[0.4.0]
|
|
232
239
|
*******
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: edx-enterprise-subsidy-client
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.2
|
|
4
4
|
Summary: Client for interacting with the enterprise-subsidy service.
|
|
5
5
|
Home-page: https://github.com/openedx/edx-enterprise-subsidy-client
|
|
6
6
|
Author: edX
|
|
@@ -225,8 +225,15 @@ Change Log
|
|
|
225
225
|
Unreleased
|
|
226
226
|
**********
|
|
227
227
|
|
|
228
|
+
[0.4.2]
|
|
229
|
+
*******
|
|
228
230
|
* Switch from ``edx-sphinx-theme`` to ``sphinx-book-theme`` since the former is
|
|
229
231
|
deprecated
|
|
232
|
+
* Add python 3.12 support
|
|
233
|
+
|
|
234
|
+
[0.4.1]
|
|
235
|
+
*******
|
|
236
|
+
* chore: add a unit test for ``create_subsidy_transaction()``.
|
|
230
237
|
|
|
231
238
|
[0.4.0]
|
|
232
239
|
*******
|
{edx-enterprise-subsidy-client-0.4.0 → edx-enterprise-subsidy-client-0.4.2}/tests/test_client.py
RENAMED
|
@@ -17,9 +17,7 @@ def test_client_init():
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
@mock.patch('edx_enterprise_subsidy_client.client.OAuthAPIClient', return_value=mock.MagicMock())
|
|
20
|
-
def test_client_fetch_subsidy_content_data_success(
|
|
21
|
-
mock_oauth_client,
|
|
22
|
-
):
|
|
20
|
+
def test_client_fetch_subsidy_content_data_success(mock_oauth_client):
|
|
23
21
|
"""
|
|
24
22
|
Test the client's ability to handle api requests to fetch subsidy content metadata from the subsidy service
|
|
25
23
|
"""
|
|
@@ -40,9 +38,50 @@ def test_client_fetch_subsidy_content_data_success(
|
|
|
40
38
|
|
|
41
39
|
|
|
42
40
|
@mock.patch('edx_enterprise_subsidy_client.client.OAuthAPIClient', return_value=mock.MagicMock())
|
|
43
|
-
def
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
def test_client_v2_create_subsidy_transaction(mock_oauth_client):
|
|
42
|
+
"""
|
|
43
|
+
Test the client's ability to create subsidy transactions.
|
|
44
|
+
"""
|
|
45
|
+
mocked_data = {
|
|
46
|
+
'uuid': str(uuid.uuid4()),
|
|
47
|
+
'state': 'committed',
|
|
48
|
+
'other': 'stuff',
|
|
49
|
+
}
|
|
50
|
+
mock_post = mock_oauth_client.return_value.post
|
|
51
|
+
mock_post.return_value = MockResponse(mocked_data, 201)
|
|
52
|
+
|
|
53
|
+
subsidy_service_client = EnterpriseSubsidyAPIClientV2()
|
|
54
|
+
|
|
55
|
+
payload = {
|
|
56
|
+
'subsidy_uuid': uuid.uuid4(),
|
|
57
|
+
'lms_user_id': 47,
|
|
58
|
+
'content_key': 'demo-x',
|
|
59
|
+
'subsidy_access_policy_uuid': uuid.uuid4(),
|
|
60
|
+
'metadata': {'key': 'value'},
|
|
61
|
+
'idempotency_key': 'hello',
|
|
62
|
+
'requested_price_cents': 123,
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
response = subsidy_service_client.create_subsidy_transaction(**payload)
|
|
66
|
+
|
|
67
|
+
assert response == mocked_data
|
|
68
|
+
expected_url = EnterpriseSubsidyAPIClientV2.TRANSACTIONS_LIST_ENDPOINT.format(
|
|
69
|
+
subsidy_uuid=payload['subsidy_uuid'],
|
|
70
|
+
)
|
|
71
|
+
expected_post_payload = {
|
|
72
|
+
'subsidy_uuid': str(payload['subsidy_uuid']),
|
|
73
|
+
'lms_user_id': 47,
|
|
74
|
+
'content_key': 'demo-x',
|
|
75
|
+
'subsidy_access_policy_uuid': str(payload['subsidy_access_policy_uuid']),
|
|
76
|
+
'metadata': {'key': 'value'},
|
|
77
|
+
'idempotency_key': 'hello',
|
|
78
|
+
'requested_price_cents': 123,
|
|
79
|
+
}
|
|
80
|
+
mock_post.assert_called_once_with(expected_url, json=expected_post_payload)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
@mock.patch('edx_enterprise_subsidy_client.client.OAuthAPIClient', return_value=mock.MagicMock())
|
|
84
|
+
def test_v2_list_subsidy_transactions(mock_oauth_client):
|
|
46
85
|
"""
|
|
47
86
|
Test the v2 client's ability to make API requests to the admin/transactions list view.
|
|
48
87
|
Really just tests some method signatures.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{edx-enterprise-subsidy-client-0.4.0 → edx-enterprise-subsidy-client-0.4.2}/requirements/base.in
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|