Skip to content

Commit

Permalink
tests: add vcr test for fields
Browse files Browse the repository at this point in the history
  • Loading branch information
gadomski committed May 23, 2024
1 parent 9bb4055 commit 4c5c452
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 0 deletions.
59 changes: 59 additions & 0 deletions tests/cassettes/test_item_search/test_fields.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions tests/test_item_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -835,3 +835,18 @@ def test_naive_datetime() -> None:
method="POST",
)
assert search.get_parameters()["datetime"] == "2024-05-14T04:25:42Z"


@pytest.mark.vcr
def test_fields() -> None:
search = ItemSearch(
url="https://earth-search.aws.element84.com/v1/search",
collections=["sentinel-2-c1-l2a"],
intersects={"type": "Point", "coordinates": [-105.1019, 40.1672]},
max_items=1,
fields=["-geometry", "-assets", "-links"],
)
item = next(search.items_as_dicts())
assert "geometry" not in item
assert "assets" not in item
assert "links" not in item

0 comments on commit 4c5c452

Please sign in to comment.