def test_wps_Duration(): client = client_for(Service(processes=[ Duration(), ], cfgfiles=CFG_FILE)) datainputs = "resource=files@xlink:href={0};grouping={1};threshold={2};operation={3};summary={4}".format( TESTDATA['cmip3_tas_sresb1_da_nc'], 'yr', 300., 'gt', 'mean') resp = client.get(service='WPS', request='Execute', version='1.0.0', identifier='duration', datainputs=datainputs) assert_response_success(resp)
def test_wps_FreezeThaw(): client = client_for( Service(processes=[ FreezeThawProcess(), ], cfgfiles=CFG_FILE)) datainputs = "resource=files@xlink:href={0};grouping={1};threshold={2}".format( TESTDATA['cmip3_tas_sresb1_da_nc'], 'yr', 10.) resp = client.get(service='WPS', request='Execute', version='1.0.0', identifier='freezethaw', datainputs=datainputs) assert_response_success(resp)
def test_wps_ICCLIM_TX10P(): client = client_for( Service(processes=[ ICCLIM_TX10PProcess(), ], cfgfiles=CFG_FILE)) datainputs = "resource=files@xlink:href={0};grouping={1}".format( TESTDATA['cmip3_tas_sresb1_da_nc'], 'yr') resp = client.get(service='WPS', request='Execute', version='1.0.0', identifier='icclim_TX10p', datainputs=datainputs) assert_response_success(resp)
def test_wps_ICCLIM_DTR(): client = client_for( Service(processes=[ ICCLIM_DTRProcess(), ], cfgfiles=CFG_FILE)) datainputs = "tasmax=files@xlink:href={0};tasmin=files@xlink:href={1};grouping={2}".format( TESTDATA['cmip3_tasmax_sresa2_da_nc'], TESTDATA['cmip3_tasmin_sresa2_da_nc'], 'mon') resp = client.get(service='WPS', request='Execute', version='1.0.0', identifier='icclim_DTR', datainputs=datainputs) assert_response_success(resp)
def test_wps_OuranosPublicIndicatorProcess(): env.OVERWRITE = True client = client_for(Service(processes=[ OuranosPublicIndicatorProcess(), ])) datainputs = "tas=files@xlink:href={0};tasmin=files@xlink:href={1};tasmax=files@xlink:href={2};pr=files@xlink:href={3};grouping={4};".format( TESTDATA['cmip3_tas_sresa2_da_nc'], TESTDATA['cmip3_tasmin_sresa2_da_nc'], TESTDATA['cmip3_tasmax_sresa2_da_nc'], TESTDATA['cmip3_pr_sresa2_da_nc'], 'yr', ) resp = client.get(service='WPS', request='Execute', version='1.0.0', identifier='ouranos_public_indicators', datainputs=datainputs) assert_response_success(resp)
def test_wps_kddm(): obs = os.path.join(CLIMOD_DIR, 'tmax.obs.nc') cur = os.path.join(CLIMOD_DIR, 'tmax.cur.nc') fut = os.path.join(CLIMOD_DIR, 'tmax.fut.nc') client = client_for( Service(processes=[KDDM_BC_Process()], cfgfiles=CFG_FILE)) datainputs = ("obs=files@xlink:href={0};" "ref=files@xlink:href={1};" "fut=files@xlink:href={2}").format(obs, cur, fut) resp = client.get(service='WPS', request='Execute', version='1.0.0', datainputs=datainputs, identifier='kddm_bc') #print(resp.response[0]) assert_response_success(resp) out = get_output(resp.xml) compare_bc_output(obs[6:], cur[6:], fut[6:], out['output_netcdf_ref'][6:], out['output_netcdf_fut'][6:]) return resp