Skip to content

Commit

Permalink
Merge pull request #516 from itcarroll/obdaac
Browse files Browse the repository at this point in the history
add obdaac s3-credential endpoint
  • Loading branch information
betolink authored Apr 12, 2024
2 parents 493dd03 + 8dc3a1f commit 8d65d03
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
6 changes: 3 additions & 3 deletions earthaccess/daac.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@
{
"short-name": "OBDAAC",
"name": "NASA's Ocean Biology Distributed Active Archive Center",
"homepage": "https://earthdata.nasa.gov/eosdis/daacs/obdaac",
"cloud-providers": [],
"homepage": "https://oceancolor.gsfc.nasa.gov/",
"cloud-providers": ["OB_CLOUD"],
"on-prem-providers": ["OB_DAAC"],
"s3-credentials": "",
"s3-credentials": "https://obdaac-tea.earthdatacloud.nasa.gov/s3credentials",
"eulas": [],
},
{
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/test_collection_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ def test_query_can_find_cloud_provider():
assert query.params["provider"] == "POCLOUD"
query = DataCollections().cloud_hosted(True).daac("PODAAC")
assert query.params["provider"] == "POCLOUD"
# OBDAAC does not have a cloud provider so it should default to the on prem provider
query = DataCollections().cloud_hosted(True).daac("OBDAAC")
assert query.params["provider"] == "OB_DAAC"
# SEDAC does not have a cloud provider so it should default to the on prem provider
query = DataCollections().cloud_hosted(True).daac("SEDAC")
assert query.params["provider"] == "SEDAC"


def test_querybuilder_can_handle_doi():
Expand Down
11 changes: 10 additions & 1 deletion tests/unit/test_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,15 @@ def test_store_can_create_s3_fsspec_session(self):

store = Store(self.auth)
self.assertTrue(isinstance(store.auth, Auth))
for daac in ["NSIDC", "PODAAC", "LPDAAC", "ORNLDAAC", "GES_DISC", "ASF"]:
for daac in [
"NSIDC",
"PODAAC",
"LPDAAC",
"ORNLDAAC",
"GES_DISC",
"ASF",
"OBDAAC",
]:
s3_fs = store.get_s3fs_session(daac=daac)
assert isinstance(s3_fs, s3fs.S3FileSystem)
assert s3_fs.storage_options == expected_storage_options
Expand All @@ -114,6 +122,7 @@ def test_store_can_create_s3_fsspec_session(self):
"ORNL_CLOUD",
"GES_DISC",
"ASF",
"OB_CLOUD",
]:
s3_fs = store.get_s3fs_session(provider=provider)
assert isinstance(s3_fs, s3fs.S3FileSystem)
Expand Down

0 comments on commit 8d65d03

Please sign in to comment.