Skip to content

Commit

Permalink
properly test datetime extents
Browse files Browse the repository at this point in the history
  • Loading branch information
hrodmn committed Nov 22, 2023
1 parent d2993da commit c870158
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ def app_no_extents(database_url, monkeypatch):
schemas=["myschema", "public"],
spatial_extent=False,
datetime_extent=False,
only_spatial_tables=False,
)
sql_settings = CustomSQLSettings(custom_sql_directory=SQL_FUNCTIONS_DIRECTORY)

Expand All @@ -372,6 +373,7 @@ def app_no_spatial_extent(database_url, monkeypatch):
schemas=["myschema", "public"],
spatial_extent=False,
datetime_extent=True,
only_spatial_tables=False,
)
sql_settings = CustomSQLSettings(custom_sql_directory=SQL_FUNCTIONS_DIRECTORY)

Expand Down
13 changes: 13 additions & 0 deletions tests/routes/test_collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,12 @@ def test_collections_no_extents(app_no_extents):
] # default value
assert not body["extent"].get("temporal")

# check a table with datetime column
response = app_no_extents.get("/collections/public.nongeo_data")
assert response.status_code == 200
body = response.json()
assert not body.get("extent")


def test_collections_no_spatial_extent(app_no_spatial_extent):
"""Test /collections endpoint."""
Expand All @@ -314,3 +320,10 @@ def test_collections_no_spatial_extent(app_no_spatial_extent):
90,
]
]

# check a table with datetime column
response = app_no_spatial_extent.get("/collections/public.nongeo_data")
assert response.status_code == 200
body = response.json()
assert not body["extent"].get("spatial")
assert body["extent"].get("temporal")

0 comments on commit c870158

Please sign in to comment.