Skip to content

Commit e4c69c0

Browse files
committed
Get rid of txn_client in test_queryables_enum_platform
1 parent ab2eb10 commit e4c69c0

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

stac_fastapi/tests/extensions/test_filter.py

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@
77

88
import pytest
99
from httpx import AsyncClient
10-
from stac_pydantic import api
11-
12-
from stac_fastapi.core.core import TransactionsClient
13-
14-
from ..conftest import MockRequest
1510

1611
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
1712

@@ -636,16 +631,14 @@ async def test_search_filter_extension_cql2text_s_disjoint_property(app_client,
636631
@pytest.mark.asyncio
637632
async def test_queryables_enum_platform(
638633
app_client: AsyncClient,
639-
txn_client: TransactionsClient,
640634
load_test_data: Callable[[str], Dict],
641635
):
642636
# Arrange
643637
# Create collection
644638
collection_data = load_test_data("test_collection.json")
645639
collection_id = collection_data["id"] = "enum-test-collection"
646-
await txn_client.create_collection(
647-
api.Collection(**collection_data), request=MockRequest
648-
)
640+
r = await app_client.post("/collections", json=collection_data)
641+
r.raise_for_status()
649642

650643
# Create items with different platform values
651644
NUM_ITEMS = 3
@@ -654,12 +647,8 @@ async def test_queryables_enum_platform(
654647
item_data["id"] = f"enum-test-item-{i}"
655648
item_data["collection"] = collection_id
656649
item_data["properties"]["platform"] = "landsat-8" if i % 2 else "sentinel-2"
657-
await txn_client.create_item(
658-
collection_id=collection_id,
659-
item=api.Item(**item_data),
660-
request=MockRequest,
661-
refresh=i == NUM_ITEMS,
662-
)
650+
r = await app_client.post(f"/collections/{collection_id}/items", json=item_data)
651+
r.raise_for_status()
663652

664653
# Act
665654
# Test queryables endpoint
@@ -677,4 +666,5 @@ async def test_queryables_enum_platform(
677666
assert set(platform_values) == {"landsat-8", "sentinel-2"}
678667

679668
# Clean up
680-
await txn_client.delete_collection(collection_id)
669+
r = await app_client.delete(f"/collections/{collection_id}")
670+
r.raise_for_status()

0 commit comments

Comments
 (0)