def save_api_status(out_dir: str = '.'): colors = {'up': 'green', 'down': 'red', 'unknown': 'black'} api_expected = ['erddap', 'argovis'] api_available = list_available_data_src() for api in api_expected: if api in api_available: check_this_api(out_dir, colors, api, api_available[api]) else: skip_this_api(out_dir, colors, api)
return connected, func def _xfail(name, msg): func = pytest.mark.xfail(run=name, reason=msg) return name, func from argopy.utilities import ( list_available_data_src, list_available_index_src, isconnected, erddap_ds_exists, ) AVAILABLE_SOURCES = list_available_data_src() AVAILABLE_INDEX_SOURCES = list_available_index_src() CONNECTED = isconnected() has_fetcher, requires_fetcher = _connectskip( len(AVAILABLE_SOURCES) > 0, "requires at least one data fetcher") has_fetcher_index, requires_fetcher_index = _connectskip( len(AVAILABLE_INDEX_SOURCES) > 0, "requires at least one index fetcher") ########## # ERDDAP # ########## if CONNECTED: DSEXISTS = erddap_ds_exists(ds="ArgoFloats") DSEXISTS_bgc = erddap_ds_exists(ds="ArgoFloats-bio") DSEXISTS_ref = erddap_ds_exists(ds="ArgoFloats-ref")