Skip to content

Commit c95db9f

Browse files
committed
tests update
1 parent 70c3497 commit c95db9f

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

services/catalog/rs_server_catalog/user_catalog.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,9 +401,8 @@ def update_stac_item_publication( # pylint: disable=too-many-locals
401401
# Check if the S3 key exists
402402
if not self.check_s3_key(item, asset, s3_key):
403403
# update the 'href' key with the download link
404-
item_id = self.request_ids["item_id"]
405404
new_href = f"https://{request.url.netloc}/catalog/\
406-
collections/{user}:{collection_id}/items/{item_id}/download/{asset}"
405+
collections/{user}:{collection_id}/items/{self.request_ids['item_id']}/download/{asset}"
407406
content["assets"][asset].update({"href": new_href})
408407
# Update the S3 path to use the catalog bucket and create the alternate field
409408
new_s3_href = {"s3": {"href": s3_key}}

services/staging/tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def staging(mocker):
136136
"""Fixture to mock the Staging object"""
137137
# Mock dependencies for Staging
138138
mock_credentials = mocker.Mock()
139-
mock_credentials.headers = {"cookie": "fake-cookie"}
139+
mock_credentials.headers = {"cookie": "fake-cookie", "host": "fake-host"}
140140
mock_input_collection = mocker.Mock()
141141
mock_collection = "test_collection"
142142
mock_item = "test_item"

services/staging/tests/test_rspy_processor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,7 @@ def test_publish_rspy_feature_success(self, mocker, staging_instance):
11071107
assert result is True # Should return True for successful publishing
11081108
mock_post.assert_called_once_with(
11091109
f"{staging_instance.catalog_url}/catalog/collections/{staging_instance.catalog_collection}/items",
1110-
headers={"cookie": "fake-cookie"},
1110+
headers={"cookie": "fake-cookie", "host": "fake-host"},
11111111
data=feature.json(),
11121112
timeout=10,
11131113
)
@@ -1136,7 +1136,7 @@ def test_publish_rspy_feature_fail(self, mocker, staging_instance):
11361136
assert result is False # Should return False for failure
11371137
mock_post.assert_called_once_with(
11381138
f"{staging_instance.catalog_url}/catalog/collections/{staging_instance.catalog_collection}/items",
1139-
headers={"cookie": "fake-cookie"},
1139+
headers={"cookie": "fake-cookie", "host": "fake-host"},
11401140
data=feature.json(),
11411141
timeout=10,
11421142
)

0 commit comments

Comments
 (0)