Running ‘testthat.R’ [6s/16s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(tidygeocoder)
  > 
  > test_check("tidygeocoder")
  ── 1. Error: geocode default colnames (@test-geocode.R#3)  ─────────────────────
  Couldn't connect to server
  1: sample_addresses %>% dplyr::slice(1) %>% geocode(addr) at testthat/test-geocode.R:3
  2: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  3: eval(quote(`_fseq`(`_lhs`)), env, env)
  4: eval(quote(`_fseq`(`_lhs`)), env, env)
  5: `_fseq`(`_lhs`)
  6: freduce(value, `_function_list`)
  7: withVisible(function_list[[k]](value))
  8: function_list[[k]](value)
  9: geocode(., addr)
  10: tibble(temp = purrr::map(.tbl %>% dplyr::pull(!!address), !!func, lat = !!lat, long = !!long, 
         ...)) %>% tidyr::unnest(temp, keep_empty = TRUE)
  ...
  13: tibble(temp = purrr::map(.tbl %>% dplyr::pull(!!address), !!func, lat = !!lat, long = !!long, 
         ...))
  14: lst_quos(xs, transform = expand_lst)
  15: eval_tidy(xs[[i]], unique_output)
  16: purrr::map(.tbl %>% dplyr::pull(~addr), ~function (address, lat = lat, long = long, 
         verbose = FALSE, benchmark = 4, API_URL = "https://geocoding.geo.census.gov/geocoder/locations/onelineaddress?") 
     {
         lat <- rlang::enquo(lat)
         long <- rlang::enquo(long)
         NA_value <- tibble::tibble(`:=`(!!lat, numeric()), `:=`(!!long, numeric()))
         if (verbose == TRUE) {
             message(address)
         }
         if (!is.na(suppressWarnings(as.numeric(address))) | !is.character(address) | 
             is.na(address) | stringr::str_trim(address) == "") {
             if (verbose == TRUE) {
                 message("Blank or missing address!")
             }
             NA_value
         }
         else {
             soup <- httr::GET(url = API_URL, query = list(address = address, format = "json", 
                 benchmark = benchmark))
             dat <- jsonlite::fromJSON(httr::content(soup, as = "text", encoding = "ISO-8859-1"), 
                 simplifyVector = TRUE)
             coords <- dat$result$addressMatches$coordinates
             if (!is.null(coords)) {
                 tibble::tibble(`:=`(!!lat, coords$y[1]), `:=`(!!long, coords$x[1]))
             }
             else {
                 NA_value
             }
         }
     }, lat = ~lat, long = ~long, ...)
  17: .f(.x[[i]], ...)
  18: httr::GET(url = API_URL, query = list(address = address, format = "json", benchmark = benchmark))
  19: request_perform(req, hu$handle$handle)
  20: request_fetch(req$output, req$url, handle)
  21: request_fetch.write_memory(req$output, req$url, handle)
  22: curl::curl_fetch_memory(url, handle = handle)
  
  ── 2. Error: geocode custom colnames (@test-geocode.R#15)  ─────────────────────
  Couldn't connect to server
  1: sample_addresses %>% dplyr::slice(1) %>% geocode(addr, lat = "latitude", long = "longitude") at testthat/test-geocode.R:15
  2: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  3: eval(quote(`_fseq`(`_lhs`)), env, env)
  4: eval(quote(`_fseq`(`_lhs`)), env, env)
  5: `_fseq`(`_lhs`)
  6: freduce(value, `_function_list`)
  7: withVisible(function_list[[k]](value))
  8: function_list[[k]](value)
  9: geocode(., addr, lat = "latitude", long = "longitude")
  10: tibble(temp = purrr::map(.tbl %>% dplyr::pull(!!address), !!func, lat = !!lat, long = !!long, 
         ...)) %>% tidyr::unnest(temp, keep_empty = TRUE)
  ...
  13: tibble(temp = purrr::map(.tbl %>% dplyr::pull(!!address), !!func, lat = !!lat, long = !!long, 
         ...))
  14: lst_quos(xs, transform = expand_lst)
  15: eval_tidy(xs[[i]], unique_output)
  16: purrr::map(.tbl %>% dplyr::pull(~addr), ~function (address, lat = lat, long = long, 
         verbose = FALSE, benchmark = 4, API_URL = "https://geocoding.geo.census.gov/geocoder/locations/onelineaddress?") 
     {
         lat <- rlang::enquo(lat)
         long <- rlang::enquo(long)
         NA_value <- tibble::tibble(`:=`(!!lat, numeric()), `:=`(!!long, numeric()))
         if (verbose == TRUE) {
             message(address)
         }
         if (!is.na(suppressWarnings(as.numeric(address))) | !is.character(address) | 
             is.na(address) | stringr::str_trim(address) == "") {
             if (verbose == TRUE) {
                 message("Blank or missing address!")
             }
             NA_value
         }
         else {
             soup <- httr::GET(url = API_URL, query = list(address = address, format = "json", 
                 benchmark = benchmark))
             dat <- jsonlite::fromJSON(httr::content(soup, as = "text", encoding = "ISO-8859-1"), 
                 simplifyVector = TRUE)
             coords <- dat$result$addressMatches$coordinates
             if (!is.null(coords)) {
                 tibble::tibble(`:=`(!!lat, coords$y[1]), `:=`(!!long, coords$x[1]))
             }
             else {
                 NA_value
             }
         }
     }, lat = ~"latitude", long = ~"longitude", ...)
  17: .f(.x[[i]], ...)
  18: httr::GET(url = API_URL, query = list(address = address, format = "json", benchmark = benchmark))
  19: request_perform(req, hu$handle$handle)
  20: request_fetch(req$output, req$url, handle)
  21: request_fetch.write_memory(req$output, req$url, handle)
  22: curl::curl_fetch_memory(url, handle = handle)
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  [ OK: 7 | SKIPPED: 0 | WARNINGS: 0 | FAILED: 2 ]
  1. Error: geocode default colnames (@test-geocode.R#3) 
  2. Error: geocode custom colnames (@test-geocode.R#15) 
  
  Error: testthat unit tests failed
  Execution halted