Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentsarago committed Sep 5, 2024
1 parent 372f6e1 commit e65b1d3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
12 changes: 7 additions & 5 deletions tests/test_collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,12 @@ def test_collections_additional_parameters(app):
assert response.status_code == 200
resp = response.json()
assert resp["search"]["search"]["bbox"] == [-87.0251, 36.1749, -86.9999, 36.2001]
assert resp["search"]["metadata"]["bbox"] == [-87.0251, 36.1749, -86.9999, 36.2001]
assert resp["search"]["metadata"]["bounds"] == [
-87.0251,
36.1749,
-86.9999,
36.2001,
]

# ids
response = app.get(
Expand All @@ -577,7 +582,7 @@ def test_collections_additional_parameters(app):
assert response.status_code == 200
resp = response.json()
assert len(resp) == 1
assert resp[0]["id"] == "20200307aC0853000w361030"
assert resp[0]["id"] == "20200307aC0853130w361030"

# datetime
response = app.get(
Expand All @@ -587,8 +592,6 @@ def test_collections_additional_parameters(app):
assert response.status_code == 200
resp = response.json()
assert resp["search"]["search"]["datetime"] == "2020-03-07T00:00:00Z"
assert "datetime <= '2020-03-07 00:00:00+00'" in resp["search"]["_where"]
assert "end_datetime >= '2020-03-07 00:00:00+00''" in resp["search"]["_where"]

response = app.get(
"/collections/noaa-emergency-response/info",
Expand All @@ -597,4 +600,3 @@ def test_collections_additional_parameters(app):
assert response.status_code == 200
resp = response.json()
assert resp["search"]["search"]["datetime"] == "../2020-03-07T00:00:00Z"
assert "end_datetime >= '-infinity'" in resp["search"]["_where"]
6 changes: 3 additions & 3 deletions tests/test_searches.py
Original file line number Diff line number Diff line change
Expand Up @@ -750,21 +750,21 @@ def test_mosaic_list(app):
resp = response.json()
assert ["searches", "links", "context"] == list(resp)
assert len(resp["searches"]) > 0
assert len(resp["links"]) == 1
assert len(resp["links"]) >= 1

response = app.get("/searches/list?limit=1")
assert response.status_code == 200
resp = response.json()
assert ["searches", "links", "context"] == list(resp)
assert len(resp["searches"]) == 1
assert len(resp["links"]) == 2
assert len(resp["links"]) >= 2

response = app.get("/searches/list?limit=1&offset=1")
assert response.status_code == 200
resp = response.json()
assert ["searches", "links", "context"] == list(resp)
assert len(resp["searches"]) == 1
assert len(resp["links"]) == 3
assert len(resp["links"]) >= 3

query = {
"filter": {
Expand Down
2 changes: 1 addition & 1 deletion titiler/pgstac/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def SearchIdParams(
collection_id,
str(ids),
str(bbox),
str(datetime),
datetime,
),
)
@retry(
Expand Down

0 comments on commit e65b1d3

Please sign in to comment.