stac-fastapi.api 5.0.0__tar.gz → 5.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. {stac_fastapi_api-5.0.0 → stac_fastapi_api-5.0.1}/PKG-INFO +1 -1
  2. {stac_fastapi_api-5.0.0 → stac_fastapi_api-5.0.1}/stac_fastapi/api/version.py +1 -1
  3. {stac_fastapi_api-5.0.0 → stac_fastapi_api-5.0.1}/stac_fastapi.api.egg-info/PKG-INFO +1 -1
  4. {stac_fastapi_api-5.0.0 → stac_fastapi_api-5.0.1}/tests/test_app.py +39 -1
  5. {stac_fastapi_api-5.0.0 → stac_fastapi_api-5.0.1}/README.md +0 -0
  6. {stac_fastapi_api-5.0.0 → stac_fastapi_api-5.0.1}/setup.cfg +0 -0
  7. {stac_fastapi_api-5.0.0 → stac_fastapi_api-5.0.1}/setup.py +0 -0
  8. {stac_fastapi_api-5.0.0 → stac_fastapi_api-5.0.1}/stac_fastapi/api/__init__.py +0 -0
  9. {stac_fastapi_api-5.0.0 → stac_fastapi_api-5.0.1}/stac_fastapi/api/app.py +0 -0
  10. {stac_fastapi_api-5.0.0 → stac_fastapi_api-5.0.1}/stac_fastapi/api/config.py +0 -0
  11. {stac_fastapi_api-5.0.0 → stac_fastapi_api-5.0.1}/stac_fastapi/api/errors.py +0 -0
  12. {stac_fastapi_api-5.0.0 → stac_fastapi_api-5.0.1}/stac_fastapi/api/middleware.py +0 -0
  13. {stac_fastapi_api-5.0.0 → stac_fastapi_api-5.0.1}/stac_fastapi/api/models.py +0 -0
  14. {stac_fastapi_api-5.0.0 → stac_fastapi_api-5.0.1}/stac_fastapi/api/openapi.py +0 -0
  15. {stac_fastapi_api-5.0.0 → stac_fastapi_api-5.0.1}/stac_fastapi/api/routes.py +0 -0
  16. {stac_fastapi_api-5.0.0 → stac_fastapi_api-5.0.1}/stac_fastapi.api.egg-info/SOURCES.txt +0 -0
  17. {stac_fastapi_api-5.0.0 → stac_fastapi_api-5.0.1}/stac_fastapi.api.egg-info/dependency_links.txt +0 -0
  18. {stac_fastapi_api-5.0.0 → stac_fastapi_api-5.0.1}/stac_fastapi.api.egg-info/not-zip-safe +0 -0
  19. {stac_fastapi_api-5.0.0 → stac_fastapi_api-5.0.1}/stac_fastapi.api.egg-info/requires.txt +0 -0
  20. {stac_fastapi_api-5.0.0 → stac_fastapi_api-5.0.1}/stac_fastapi.api.egg-info/top_level.txt +0 -0
  21. {stac_fastapi_api-5.0.0 → stac_fastapi_api-5.0.1}/tests/test_api.py +0 -0
  22. {stac_fastapi_api-5.0.0 → stac_fastapi_api-5.0.1}/tests/test_app_prefix.py +0 -0
  23. {stac_fastapi_api-5.0.0 → stac_fastapi_api-5.0.1}/tests/test_middleware.py +0 -0
  24. {stac_fastapi_api-5.0.0 → stac_fastapi_api-5.0.1}/tests/test_models.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: stac-fastapi.api
3
- Version: 5.0.0
3
+ Version: 5.0.1
4
4
  Summary: An implementation of STAC API based on the FastAPI framework.
5
5
  Home-page: https://github.com/stac-utils/stac-fastapi
6
6
  Author: Arturo Engineering
@@ -1,3 +1,3 @@
1
1
  """Library version."""
2
2
 
3
- __version__ = "5.0.0"
3
+ __version__ = "5.0.1"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: stac-fastapi.api
3
- Version: 5.0.0
3
+ Version: 5.0.1
4
4
  Summary: An implementation of STAC API based on the FastAPI framework.
5
5
  Home-page: https://github.com/stac-utils/stac-fastapi
6
6
  Author: Arturo Engineering
@@ -15,7 +15,11 @@ from stac_fastapi.api.models import (
15
15
  create_get_request_model,
16
16
  create_post_request_model,
17
17
  )
18
- from stac_fastapi.extensions.core import FieldsExtension, FilterExtension
18
+ from stac_fastapi.extensions.core import (
19
+ FieldsExtension,
20
+ FilterExtension,
21
+ SearchFilterExtension,
22
+ )
19
23
  from stac_fastapi.types import stac
20
24
  from stac_fastapi.types.config import ApiSettings
21
25
  from stac_fastapi.types.core import BaseCoreClient, NumType
@@ -184,6 +188,40 @@ def test_filter_extension(validate, TestCoreClient, item_dict):
184
188
  )
185
189
 
186
190
  assert landing.status_code == 200, landing.text
191
+ assert "Queryables" in [link.get("title") for link in landing.json()["links"]]
192
+ assert get_search.status_code == 200, get_search.text
193
+ assert post_search.status_code == 200, post_search.text
194
+
195
+ test_app = app.StacApi(
196
+ settings=ApiSettings(enable_response_models=validate),
197
+ client=FilterClient(),
198
+ search_get_request_model=create_get_request_model([SearchFilterExtension()]),
199
+ search_post_request_model=create_post_request_model([SearchFilterExtension()]),
200
+ extensions=[SearchFilterExtension()],
201
+ )
202
+
203
+ with TestClient(test_app.app) as client:
204
+ landing = client.get("/")
205
+ get_search = client.get(
206
+ "/search",
207
+ params={
208
+ "filter": "TEST",
209
+ "filter-crs": "EPSG:4326",
210
+ "filter-lang": "cql2-text",
211
+ },
212
+ )
213
+ post_search = client.post(
214
+ "/search",
215
+ json={
216
+ "collections": ["test"],
217
+ "filter": {},
218
+ "filter-crs": "EPSG:4326",
219
+ "filter-lang": "cql2-json",
220
+ },
221
+ )
222
+
223
+ assert landing.status_code == 200, landing.text
224
+ assert "Queryables" in [link.get("title") for link in landing.json()["links"]]
187
225
  assert get_search.status_code == 200, get_search.text
188
226
  assert post_search.status_code == 200, post_search.text
189
227