Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions tests/unit/test_subscription_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,21 +348,24 @@ def test_toar_tool_success():
assert res == expected


def test_pv_source_success(geom_geojson):
@pytest.mark.parametrize(
"var_type, var_id",
[
("biomass_proxy", "BIOMASS-PROXY_V3.0_10"), # actual real type and id.
("var1", "VAR1-ABCD"), # nonsense type and id
])
def test_pv_source_success(geom_geojson, var_type, var_id):
"""Configure a planetary variable subscription source."""
# NOTE: this function does not yet validate type and id.
# The nonsense values are intended to fail when the function does
# add validation.
source = subscription_request.planetary_variable_source(
"var1",
"VAR1-abcd",
var_type,
var_id,
geometry=geom_geojson,
start_time=datetime(2021, 3, 1),
end_time=datetime(2021, 3, 2),
)

assert source["type"] == "var1"
assert source["type"] == var_type
params = source["parameters"]
assert params["id"] == "VAR1-abcd"
assert params["id"] == var_id
assert params["geometry"] == geom_geojson
assert params["start_time"].startswith("2021-03-01")