Skip to content

Commit 60b7263

Browse files
Revert "Enhance STAC API tests to verify base path for landing page, collections, and item links with custom ingress paths"
This reverts commit 37d1e77.
1 parent 37d1e77 commit 60b7263

File tree

1 file changed

+2
-60
lines changed

1 file changed

+2
-60
lines changed

.github/workflows/tests/test_stac.py

Lines changed: 2 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,6 @@ def test_stac_api(stac_endpoint):
1414
# Ping
1515
assert client.get(f"{stac_endpoint}/_mgmt/ping").status_code == 200
1616

17-
# Landing page
18-
resp = client.get(stac_endpoint)
19-
assert resp.status_code == 200
20-
landing = resp.json()
21-
# Verify landing page links have correct base path
22-
for link in landing["links"]:
23-
if link["href"].startswith("/"):
24-
assert link["href"].startswith(stac_endpoint.split("://")[1])
25-
2617
# viewer
2718
#assert client.get(f"{stac_endpoint}/index.html").status_code == 200
2819
assert client.get(f"{stac_endpoint}/index.html").status_code == 404
@@ -35,21 +26,11 @@ def test_stac_api(stac_endpoint):
3526
ids = [c["id"] for c in collections]
3627
assert "noaa-emergency-response" in ids
3728

38-
# Verify collection links have correct base path
39-
for collection in collections:
40-
for link in collection["links"]:
41-
if link["href"].startswith("/"):
42-
assert link["href"].startswith(stac_endpoint.split("://")[1])
43-
4429
# items
4530
resp = client.get(f"{stac_endpoint}/collections/noaa-emergency-response/items")
4631
assert resp.status_code == 200
47-
items = resp.json()
48-
# Verify item links have correct base path
49-
for feature in items["features"]:
50-
for link in feature["links"]:
51-
if link["href"].startswith("/"):
52-
assert link["href"].startswith(stac_endpoint.split("://")[1])
32+
items = resp.json()["features"]
33+
assert len(items) == 10
5334

5435
# item
5536
resp = client.get(
@@ -70,45 +51,6 @@ def test_stac_to_raster(stac_endpoint):
7051
#assert resp.status_code == 307
7152
assert resp.status_code == 404
7253

73-
def test_stac_custom_path(stac_endpoint):
74-
"""test stac with custom ingress path."""
75-
# If we're using a custom path (e.g., /api instead of /stac)
76-
base_path = stac_endpoint.split("://")[1]
77-
78-
# Landing page
79-
resp = client.get(stac_endpoint)
80-
assert resp.status_code == 200
81-
landing = resp.json()
82-
83-
# All links should use the custom path
84-
for link in landing["links"]:
85-
if link["href"].startswith("/"):
86-
assert link["href"].startswith(base_path), \
87-
f"Link {link['href']} doesn't start with {base_path}"
88-
89-
# Collections should also use the custom path
90-
resp = client.get(f"{stac_endpoint}/collections")
91-
assert resp.status_code == 200
92-
collections = resp.json()["collections"]
93-
94-
for collection in collections:
95-
for link in collection["links"]:
96-
if link["href"].startswith("/"):
97-
assert link["href"].startswith(base_path), \
98-
f"Collection link {link['href']} doesn't start with {base_path}"
99-
100-
# Test a specific item
101-
resp = client.get(f"{stac_endpoint}/collections/noaa-emergency-response/items")
102-
assert resp.status_code == 200
103-
items = resp.json()
104-
105-
# Item links should also use the custom path
106-
for feature in items["features"]:
107-
for link in feature["links"]:
108-
if link["href"].startswith("/"):
109-
assert link["href"].startswith(base_path), \
110-
f"Item link {link['href']} doesn't start with {base_path}"
111-
11254
# viewer
11355
resp = client.get(
11456
f"{stac_endpoint}/collections/noaa-emergency-response/items/20200307aC0853300w361200/viewer",

0 commit comments

Comments
 (0)