Skip to content

Commit

Permalink
added test for time_components
Browse files Browse the repository at this point in the history
  • Loading branch information
cehbrecht committed Sep 14, 2021
1 parent 881a269 commit 9fb131a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rook/processes/wps_subset.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ def _handler(self, request, response):
request.inputs, "original_files", default=False
),
"time": parse_wps_input(request.inputs, "time", default=None),
"time_components": parse_wps_input(request.inputs, "time_components", default=None),
# TODO: use time_components when available
# "time_components": parse_wps_input(request.inputs, "time_components", default=None),
"level": parse_wps_input(request.inputs, "level", default=None),
"area": parse_wps_input(request.inputs, "area", default=None),
}
Expand Down
14 changes: 14 additions & 0 deletions tests/test_wps_subset.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,20 @@ def test_wps_subset_c3s_cmip6():
assert "meta4" in get_output(resp.xml)["output"]


def test_wps_subset_c3s_cmip6_time_components():
client = client_for(Service(processes=[Subset()], cfgfiles=[PYWPS_CFG]))
datainputs = f"collection={C3S_CMIP6_MON_COLLECTION}"
# datainputs += ";time=2015-01-01/2015-12-30"
datainputs += ";time_components=year:2015,2016|month:01,02,03"
resp = client.get(
"?service=WPS&request=Execute&version=1.0.0&identifier=subset&datainputs={}".format(
datainputs
)
)
assert_response_success(resp)
assert "meta4" in get_output(resp.xml)["output"]


def test_wps_subset_cmip6_prov():
client = client_for(Service(processes=[Subset()], cfgfiles=[PYWPS_CFG]))
datainputs = "collection=CMIP6.CMIP.IPSL.IPSL-CM6A-LR.historical.r1i1p1f1.Amon.rlds.gr.v20180803"
Expand Down

0 comments on commit 9fb131a

Please sign in to comment.