Skip to content

Commit bf79ba4

Browse files
committed
Synchronize tests-production behavior for FilterExtension
See #394
1 parent 92ed789 commit bf79ba4

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

stac_fastapi/tests/conftest.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
from stac_fastapi.core.route_dependencies import get_route_dependencies
2929
from stac_fastapi.core.utilities import get_bool_env
3030
from stac_fastapi.sfeos_helpers.aggregation import EsAsyncBaseAggregationClient
31+
from stac_fastapi.sfeos_helpers.filter import EsAsyncBaseFiltersClient
3132

3233
if os.getenv("BACKEND", "elasticsearch").lower() == "opensearch":
3334
from stac_fastapi.opensearch.config import AsyncOpensearchSettings as AsyncSettings
@@ -39,9 +40,11 @@
3940
)
4041
else:
4142
from stac_fastapi.elasticsearch.config import (
42-
ElasticsearchSettings as SearchSettings,
4343
AsyncElasticsearchSettings as AsyncSettings,
4444
)
45+
from stac_fastapi.elasticsearch.config import (
46+
ElasticsearchSettings as SearchSettings,
47+
)
4548
from stac_fastapi.elasticsearch.database_logic import (
4649
DatabaseLogic,
4750
create_collection_index,
@@ -198,6 +201,13 @@ def bulk_txn_client():
198201
async def app():
199202
settings = AsyncSettings()
200203

204+
filter_extension = FilterExtension(
205+
client=EsAsyncBaseFiltersClient(database=database)
206+
)
207+
filter_extension.conformance_classes.append(
208+
"http://www.opengis.net/spec/cql2/1.0/conf/advanced-comparison-operators"
209+
)
210+
201211
aggregation_extension = AggregationExtension(
202212
client=EsAsyncBaseAggregationClient(
203213
database=database, session=None, settings=settings
@@ -217,7 +227,7 @@ async def app():
217227
FieldsExtension(),
218228
QueryExtension(),
219229
TokenPaginationExtension(),
220-
FilterExtension(),
230+
filter_extension,
221231
FreeTextExtension(),
222232
]
223233

@@ -313,7 +323,6 @@ async def app_client_rate_limit(app_rate_limit):
313323

314324
@pytest_asyncio.fixture(scope="session")
315325
async def app_basic_auth():
316-
317326
stac_fastapi_route_dependencies = """[
318327
{
319328
"routes":[{"method":"*","path":"*"}],

0 commit comments

Comments
 (0)