diff --git a/pyproject.toml b/pyproject.toml index 1637a09..c936fa7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,9 +38,10 @@ local = ["watchdog"] publishing = ["posttroll"] ssh = ["paramiko"] dataspace = ["oauthlib", "requests_oauthlib", "s3fs"] -datastore = ["oauthlib", "requests_oauthlib"] -dhus = ["defusedxml"] +datastore = ["oauthlib", "requests_oauthlib", "aiohttp"] +dhus = ["defusedxml", "requests", "aiohttp"] selector = ["redis"] +tests = ["redis-server", "freezegun", "responses", "pytroll-watchers[minio,local,publishing,ssh,dataspace,datastore,dhus,selector]"] [build-system] requires = ["hatchling", "hatch-vcs"] diff --git a/src/pytroll_watchers/dataspace_watcher.py b/src/pytroll_watchers/dataspace_watcher.py index 7f1d272..03518de 100644 --- a/src/pytroll_watchers/dataspace_watcher.py +++ b/src/pytroll_watchers/dataspace_watcher.py @@ -122,7 +122,7 @@ def generate_download_links(filter_string, dataspace_auth, storage_options): resp = oauth.get(filter_string) metadatas = resp.get("value", []) for metadata in metadatas: - s3path = UPath("s3://" + metadata["S3Path"], **storage_options) + s3path = UPath("s3:/" + metadata["S3Path"], **storage_options) mda = dict() attributes = _construct_attributes_dict(metadata) mda["platform_name"] = attributes["platformShortName"].capitalize() + attributes["platformSerialIdentifier"] diff --git a/tests/test_copernicus_dataspace_watcher.py b/tests/test_copernicus_dataspace_watcher.py index acee1a7..91a60ed 100644 --- a/tests/test_copernicus_dataspace_watcher.py +++ b/tests/test_copernicus_dataspace_watcher.py @@ -118,10 +118,10 @@ def test_publish_paths(caplog): assert "uri" not in message_settings["data"] assert len(messages) == 3 message = Message(rawstr=messages[0]) - assert message.data["uri"] == "s3:///eodata/Sentinel-3/OLCI/OL_1_EFR___/2024/04/15/S3B_OL_1_EFR____20240415T074029_20240415T074329_20240415T094236_0179_092_035_1620_PS2_O_NR_003.SEN3" + assert message.data["uri"] == "s3://eodata/Sentinel-3/OLCI/OL_1_EFR___/2024/04/15/S3B_OL_1_EFR____20240415T074029_20240415T074329_20240415T094236_0179_092_035_1620_PS2_O_NR_003.SEN3" assert message.data["uid"] == "S3B_OL_1_EFR____20240415T074029_20240415T074329_20240415T094236_0179_092_035_1620_PS2_O_NR_003.SEN3" # noqa assert message.data["sensor"] == "olci" assert message.data["filesystem"] == {"cls": "s3fs.core:S3FileSystem", "protocol": "s3", "args": [], "profile": "someprofile"} - assert message.data["path"] == "/eodata/Sentinel-3/OLCI/OL_1_EFR___/2024/04/15/S3B_OL_1_EFR____20240415T074029_20240415T074329_20240415T094236_0179_092_035_1620_PS2_O_NR_003.SEN3" # noqa + assert message.data["path"] == "eodata/Sentinel-3/OLCI/OL_1_EFR___/2024/04/15/S3B_OL_1_EFR____20240415T074029_20240415T074329_20240415T094236_0179_092_035_1620_PS2_O_NR_003.SEN3" # noqa assert f"Starting watch on dataspace for '{filter_string}'" in caplog.text