# Path: tests/common.py
# TESTDATA = {
#     'cmip5_tasmax_2006_nc': "file://{0}".format(os.path.join(
#         TESTS_HOME,
#         'testdata',
#         'cmip5',
#         'tasmax_Amon_MPI-ESM-MR_rcp45_r1i1p1_200601-200612.nc')),
#     'cmip5_tasmax_2007_nc': "file://{0}".format(os.path.join(
#         TESTS_HOME,
#         'testdata',
#         'cmip5',
#         'tasmax_Amon_MPI-ESM-MR_rcp45_r1i1p1_200701-200712.nc')),
#     'cmip3_tas_sresb1_da_nc': "file://{0}".format(os.path.join(
#         TESTS_HOME,
#         'testdata',
#         'cmip3',
#         'tas.sresb1.giss_model_e_r.run1.atm.da.nc')),
#     'cmip3_tas_sresa2_da_nc': "file://{0}".format(os.path.join(
#         TESTS_HOME,
#         'testdata',
#         'cmip3',
#         'tas.sresa2.miub_echo_g.run1.atm.da.nc')),
#     'cmip3_tasmin_sresa2_da_nc': "file://{0}".format(os.path.join(
#         TESTS_HOME,
#         'testdata',
#         'cmip3',
#         'tasmin.sresa2.miub_echo_g.run1.atm.da.nc')),
#     'cmip3_tasmax_sresa2_da_nc': "file://{0}".format(os.path.join(
#         TESTS_HOME,
#         'testdata',
#         'cmip3',
#         'tasmax.sresa2.miub_echo_g.run1.atm.da.nc')),
#     'cmip3_pr_sresa2_da_nc': "file://{0}".format(os.path.join(
#         TESTS_HOME,
#         'testdata',
#         'cmip3',
#         'pr.sresa2.miub_echo_g.run1.atm.da.nc')),
#     'cordex_tasmax_2006_nc': "file://{0}".format(os.path.join(
#         TESTS_HOME,
#         'testdata',
#         'cordex',
#         'tasmax_EUR-44_MPI-M-MPI-ESM-LR_rcp45_r1i1p1_MPI-CSC-REMO2009_v1_mon_200602-200612.nc')),
#     'cordex_tasmax_2007_nc': "file://{0}".format(os.path.join(
#         TESTS_HOME,
#         'testdata',
#         'cordex',
#         'tasmax_EUR-44_MPI-M-MPI-ESM-LR_rcp45_r1i1p1_MPI-CSC-REMO2009_v1_mon_200701-200712.nc')),
#     'indicators_small_nc': "file://{0}".format(os.path.join(
#         TESTS_HOME,
#         'testdata',
#         'spatial_analog',
#         'indicators_small.nc')),
#     'indicators_medium_nc': "file://{0}".format(os.path.join(
#         TESTS_HOME,
#         'testdata',
#         'spatial_analog',
#         'indicators_medium.nc')),
#     'dissimilarity_nc': "file://{0}".format(os.path.join(
#         TESTS_HOME,
#         'testdata',
#         'spatial_analog',
#         'dissimilarity.nc')),
# }
# 
# def client_for(service):
#     return WpsTestClient(service, WpsTestResponse)


import pytest
from pywps import Service
from pywps.tests import assert_response_success
from .common import TESTDATA, client_for  # , CFG_FILE
    from flyingpigeon.processes import FetchProcess


try:
except Exception:
    pytestmark = pytest.mark.skip


def test_wps_fetch():
    client = client_for(Service(processes=[FetchProcess()]))
    datainputs = "resource=files@xlink:href={0}".format(TESTDATA['cmip5_tasmax_2006_nc'])
    resp = client.get(
        service='WPS', request='Execute', version='1.0.0',
        identifier='fetch_resources',

# Path: tests/common.py
# TESTDATA = {
#     'cmip5_tasmax_2006_nc': "file://{0}".format(os.path.join(
#         TESTS_HOME,
#         'testdata',
#         'cmip5',
#         'tasmax_Amon_MPI-ESM-MR_rcp45_r1i1p1_200601-200612.nc')),
#     'cmip5_tasmax_2007_nc': "file://{0}".format(os.path.join(
#         TESTS_HOME,
#         'testdata',
#         'cmip5',
#         'tasmax_Amon_MPI-ESM-MR_rcp45_r1i1p1_200701-200712.nc')),
#     'cmip3_tas_sresb1_da_nc': "file://{0}".format(os.path.join(
#         TESTS_HOME,
#         'testdata',
#         'cmip3',
#         'tas.sresb1.giss_model_e_r.run1.atm.da.nc')),
#     'cmip3_tas_sresa2_da_nc': "file://{0}".format(os.path.join(
#         TESTS_HOME,
#         'testdata',
#         'cmip3',
#         'tas.sresa2.miub_echo_g.run1.atm.da.nc')),
#     'cmip3_tasmin_sresa2_da_nc': "file://{0}".format(os.path.join(
#         TESTS_HOME,
#         'testdata',
#         'cmip3',
#         'tasmin.sresa2.miub_echo_g.run1.atm.da.nc')),
#     'cmip3_tasmax_sresa2_da_nc': "file://{0}".format(os.path.join(
#         TESTS_HOME,
#         'testdata',
#         'cmip3',
#         'tasmax.sresa2.miub_echo_g.run1.atm.da.nc')),
#     'cmip3_pr_sresa2_da_nc': "file://{0}".format(os.path.join(
#         TESTS_HOME,
#         'testdata',
#         'cmip3',
#         'pr.sresa2.miub_echo_g.run1.atm.da.nc')),
#     'cordex_tasmax_2006_nc': "file://{0}".format(os.path.join(
#         TESTS_HOME,
#         'testdata',
#         'cordex',
#         'tasmax_EUR-44_MPI-M-MPI-ESM-LR_rcp45_r1i1p1_MPI-CSC-REMO2009_v1_mon_200602-200612.nc')),
#     'cordex_tasmax_2007_nc': "file://{0}".format(os.path.join(
#         TESTS_HOME,
#         'testdata',
#         'cordex',
#         'tasmax_EUR-44_MPI-M-MPI-ESM-LR_rcp45_r1i1p1_MPI-CSC-REMO2009_v1_mon_200701-200712.nc')),
#     'indicators_small_nc': "file://{0}".format(os.path.join(
#         TESTS_HOME,
#         'testdata',
#         'spatial_analog',
#         'indicators_small.nc')),
#     'indicators_medium_nc': "file://{0}".format(os.path.join(
#         TESTS_HOME,
#         'testdata',
#         'spatial_analog',
#         'indicators_medium.nc')),
#     'dissimilarity_nc': "file://{0}".format(os.path.join(
#         TESTS_HOME,
#         'testdata',
#         'spatial_analog',
#         'dissimilarity.nc')),
# }
# 
# def client_for(service):
#     return WpsTestClient(service, WpsTestResponse)


# Path: tests/test_wps_fetch.py
import pytest
from pywps import Service
from pywps.tests import assert_response_success
from .common import TESTDATA, client_for  # , CFG_FILE
    from flyingpigeon.processes import FetchProcess



try:
except Exception:
    pytestmark = pytest.mark.skip


def test_wps_fetch():
    client = client_for(Service(processes=[FetchProcess()]))
    datainputs = "resource=files@xlink:href={0}".format(TESTDATA['cmip5_tasmax_2006_nc'])
    resp = client.get(
        service='WPS', request='Execute', version='1.0.0',
        identifier='fetch_resources',

        datainputs=datainputs)