Running ‘testthat.R’
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(rfishbase)
  > options(is_test = TRUE) # set user-agent to distinguish automated tests
  > test_check("rfishbase")
  ── 1. Error: Custom queries give desired result (@test_endpoint.R#10)  ─────────
  Failed to connect to fishbase.ropensci.org port 443: Connection refused
  1: country(query = list(C_Code = 440)) at testthat/test_endpoint.R:10
  2: dplyr::bind_rows(lapply(codes, function(code) {
         if (nchar(code) == 0 && limit > 5000) {
             k <- 0
             data <- {
             }
             while (k < limit) {
                 args <- list(SpecCode = code, limit = as.integer(min(5000, limit - k)), 
                     offset = as.integer(k + 1))
                 if (!is.null(fields)) 
                     args <- c(args, fields = paste(c("SpecCode", fields), collapse = ","))
                 if (!is.null(query)) 
                     args <- c(args, query)
                 bad_tables = c("diet", "ecosystem", "maturity", "morphdat", "morphmet", 
                     "popchar", "poplf")
                 if (endpt %in% bad_tables) {
                     names(args)[names(args) == "SpecCode"] = "Speccode"
                 }
                 resp <- httr::GET(paste0(server, "/", endpt), query = args, ..., httr::user_agent(make_ua()))
                 tmp_data <- check_and_parse(resp)
                 k <- k + 5000
                 data <- rbind(data, tmp_data)
             }
         }
         else {
             args <- list(SpecCode = code, limit = limit)
             if (!is.null(fields)) 
                 args <- c(args, fields = paste(c("SpecCode", fields), collapse = ","))
             if (!is.null(query)) 
                 args <- c(args, query)
             bad_tables = c("diet", "ecosystem", "maturity", "morphdat", "morphmet", "popchar", 
                 "poplf")
             if (endpt %in% bad_tables) {
                 names(args)[names(args) == "SpecCode"] = "Speccode"
             }
             resp <- httr::GET(paste0(server, "/", endpt), query = args, httr::user_agent(make_ua()))
             data <- check_and_parse(resp)
         }
         if (endpt %in% bad_tables && !is.null(data)) {
             names(data)[names(data) == "Speccode"] = "SpecCode"
         }
         tidy_table(data, server = server)
     }))
  3: flatten_bindable(dots_values(...))
  4: dots_values(...)
  5: map(dots, function(dot) eval_bare(dot$expr, dot$env))
  6: lapply(.x, .f, ...)
  7: FUN(X[[i]], ...)
  8: eval_bare(dot$expr, dot$env)
  9: lapply(codes, function(code) {
         if (nchar(code) == 0 && limit > 5000) {
             k <- 0
             data <- {
             }
             while (k < limit) {
                 args <- list(SpecCode = code, limit = as.integer(min(5000, limit - k)), 
                     offset = as.integer(k + 1))
                 if (!is.null(fields)) 
                     args <- c(args, fields = paste(c("SpecCode", fields), collapse = ","))
                 if (!is.null(query)) 
                     args <- c(args, query)
                 bad_tables = c("diet", "ecosystem", "maturity", "morphdat", "morphmet", 
                     "popchar", "poplf")
                 if (endpt %in% bad_tables) {
                     names(args)[names(args) == "SpecCode"] = "Speccode"
                 }
                 resp <- httr::GET(paste0(server, "/", endpt), query = args, ..., httr::user_agent(make_ua()))
                 tmp_data <- check_and_parse(resp)
                 k <- k + 5000
                 data <- rbind(data, tmp_data)
             }
         }
         else {
             args <- list(SpecCode = code, limit = limit)
             if (!is.null(fields)) 
                 args <- c(args, fields = paste(c("SpecCode", fields), collapse = ","))
             if (!is.null(query)) 
                 args <- c(args, query)
             bad_tables = c("diet", "ecosystem", "maturity", "morphdat", "morphmet", "popchar", 
                 "poplf")
             if (endpt %in% bad_tables) {
                 names(args)[names(args) == "SpecCode"] = "Speccode"
             }
             resp <- httr::GET(paste0(server, "/", endpt), query = args, httr::user_agent(make_ua()))
             data <- check_and_parse(resp)
         }
         if (endpt %in% bad_tables && !is.null(data)) {
             names(data)[names(data) == "Speccode"] = "SpecCode"
         }
         tidy_table(data, server = server)
     })
  10: FUN(X[[i]], ...)
  11: httr::GET(paste0(server, "/", endpt), query = args, httr::user_agent(make_ua()))
  12: request_perform(req, hu$handle$handle)
  13: request_fetch(req$output, req$url, handle)
  14: request_fetch.write_memory(req$output, req$url, handle)
  15: curl::curl_fetch_memory(url, handle = handle)
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 35 SKIPPED: 32 FAILED: 1
  1. Error: Custom queries give desired result (@test_endpoint.R#10) 
  
  Error: testthat unit tests failed
  Execution halted