R Under development (unstable) (2024-06-18 r86781 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library("testthat") > library("rnrfa") > # library("lintr") > > api_unavailable <- function(){ + resp1 <- httr::GET(url = "https://nrfaapps.ceh.ac.uk/nrfa/ws/time-series", + query = list(format = "json-object", station = 39001,`data-type` = "gdf"), + httr::user_agent("https://github.com/ilapros/rnrfa")) + resp2 <- httr::GET(url = "https://nrfaapps.ceh.ac.uk/nrfa/ws/time-series", + query = list(format = "json-object", station = 39001,`data-type` = "cmr"), + httr::user_agent("https://github.com/ilapros/rnrfa")) + # if any of the two streams is not working skip tests + (httr::http_error(resp1) | httr::http_error(resp2)) + } > > # skip_if_no_api() <- function() { > # if (api_unavailable()) { > # skip("API not available") > # } > # } > > if (!curl::has_internet()) { + message("No internet, cannot run tests") + }else { + test_check("rnrfa") + } [ FAIL 0 | WARN 0 | SKIP 1 | PASS 65 ] ══ Skipped tests (1) ═══════════════════════════════════════════════════════════ • On Windows (1): 'test-gdf.R:32:3' [ FAIL 0 | WARN 0 | SKIP 1 | PASS 65 ] > > proc.time() user system elapsed 31.73 1.79 43.31