Skip to content

Commit

Permalink
feat: Update catalog API client to use v2 endpoints
Browse files Browse the repository at this point in the history
ENT-9410
  • Loading branch information
pwnage101 committed Nov 14, 2024
1 parent 9732d12 commit 1b1508e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class EnterpriseCatalogApiClient(BaseOAuthClient):
"""
API client for calls to the enterprise catalog service.
"""
api_base_url = settings.ENTERPRISE_CATALOG_URL + '/api/v1/'
api_base_url = settings.ENTERPRISE_CATALOG_URL + '/api/v2/'
enterprise_catalog_endpoint = api_base_url + 'enterprise-catalogs/'

@backoff.on_exception(wait_gen=backoff.expo, exception=autoretry_for_exceptions)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def test_contains_content_items(self, mock_oauth_client, mock_json):
assert contains_content_items

mock_oauth_client.return_value.get.assert_called_with(
f'http://enterprise-catalog.example.com/api/v1/enterprise-catalogs/{ent_uuid}/contains_content_items/',
f'http://enterprise-catalog.example.com/api/v2/enterprise-catalogs/{ent_uuid}/contains_content_items/',
params={'course_run_ids': ['AB+CD101']},
)

Expand Down Expand Up @@ -65,7 +65,7 @@ def test_catalog_content_metadata(self, mock_oauth_client):

self.assertEqual(fetched_metadata['results'], mock_response_json['results'])
mock_oauth_client.return_value.get.assert_called_with(
f'http://enterprise-catalog.example.com/api/v1/enterprise-catalogs/{customer_uuid}/get_content_metadata/',
f'http://enterprise-catalog.example.com/api/v2/enterprise-catalogs/{customer_uuid}/get_content_metadata/',
params={
'content_keys': content_keys,
'traverse_pagination': True,
Expand All @@ -87,7 +87,7 @@ def test_catalog_content_metadata_raises_http_error(self, mock_oauth_client):
client.catalog_content_metadata(customer_uuid, content_keys)

mock_oauth_client.return_value.get.assert_called_with(
f'http://enterprise-catalog.example.com/api/v1/enterprise-catalogs/{customer_uuid}/get_content_metadata/',
f'http://enterprise-catalog.example.com/api/v2/enterprise-catalogs/{customer_uuid}/get_content_metadata/',
params={
'content_keys': content_keys,
'traverse_pagination': True,
Expand All @@ -109,5 +109,5 @@ def test_get_content_metadata_count(self, mock_oauth_client):

self.assertEqual(fetched_metadata, mock_response_json['count'])
mock_oauth_client.return_value.get.assert_called_with(
f'http://enterprise-catalog.example.com/api/v1/enterprise-catalogs/{catalog_uuid}/get_content_metadata/',
f'http://enterprise-catalog.example.com/api/v2/enterprise-catalogs/{catalog_uuid}/get_content_metadata/',
)

0 comments on commit 1b1508e

Please sign in to comment.