Running 'testthat.R' [11m]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(terrainr)
  > 
  > test_check("terrainr")
  Starting 2 test processes
  [ FAIL 3 | WARN 21 | SKIP 22 | PASS 22 ]
  
  ══ Skipped tests ═══════════════════════════════════════════════════════════════
  • On CRAN (21)
  • On Windows (1)
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-2-get_tiles_3dep.R:67'): specifying SR works ───────────────────
  Error in `httr::status_code(img_res)`: object 'img_res' not found
  Backtrace:
       ▆
    1. ├─terrainr::get_tiles(dat) at test-2-get_tiles_3dep.R:67:2
    2. └─terrainr:::get_tiles.sf(dat)
    3.   └─terrainr:::get_tiles_internal(...)
    4.     └─terrainr::hit_national_map_api(...)
    5.       └─terrainr (local) get_href()
    6.         └─terrainr (local) get_href(counter = counter + 1)
    7.           └─terrainr (local) get_href(counter = counter + 1)
    8.             └─terrainr (local) get_href(counter = counter + 1)
    9.               └─terrainr (local) get_href(counter = counter + 1)
   10.                 └─terrainr (local) get_href(counter = counter + 1)
   11.                   ├─base::stop("Map server returned error code ", httr::status_code(img_res))
   12.                   │ └─base::.makeMessage(..., domain = domain)
   13.                   │   └─base::lapply(list(...), as.character)
   14.                   └─httr::status_code(img_res)
  ── Error ('test-4-merge_rasters.R:110'): overwrite works as expected ───────────
  Error in `httr::status_code(img_res)`: object 'img_res' not found
  Backtrace:
       ▆
    1. ├─terrainr::get_tiles(first_tile) at test-4-merge_rasters.R:110:2
    2. └─terrainr:::get_tiles.sfc(first_tile)
    3.   ├─terrainr::get_tiles(...)
    4.   └─terrainr:::get_tiles.sf(...)
    5.     └─terrainr:::get_tiles_internal(...)
    6.       └─terrainr::hit_national_map_api(...)
    7.         └─terrainr (local) get_href()
    8.           └─terrainr (local) get_href(counter = counter + 1)
    9.             └─terrainr (local) get_href(counter = counter + 1)
   10.               └─terrainr (local) get_href(counter = counter + 1)
   11.                 └─terrainr (local) get_href(counter = counter + 1)
   12.                   └─terrainr (local) get_href(counter = counter + 1)
   13.                     ├─base::stop("Map server returned error code ", httr::status_code(img_res))
   14.                     │ └─base::.makeMessage(..., domain = domain)
   15.                     │   └─base::lapply(list(...), as.character)
   16.                     └─httr::status_code(img_res)
  ── Error ('test-get_tiles.R:5'): SpatRast method is consistent ─────────────────
  Error in `httr::status_code(img_res)`: object 'img_res' not found
  Backtrace:
       ▆
    1. ├─terrainr::get_tiles(tmp_raster, bboxSR = 4326, imageSR = 4326) at test-get_tiles.R:5:2
    2. └─terrainr:::get_tiles.SpatRaster(tmp_raster, bboxSR = 4326, imageSR = 4326)
    3.   └─terrainr:::get_tiles_internal(...)
    4.     └─terrainr::hit_national_map_api(...)
    5.       └─terrainr (local) get_href()
    6.         └─terrainr (local) get_href(counter = counter + 1)
    7.           └─terrainr (local) get_href(counter = counter + 1)
    8.             └─terrainr (local) get_href(counter = counter + 1)
    9.               └─terrainr (local) get_href(counter = counter + 1)
   10.                 └─terrainr (local) get_href(counter = counter + 1)
   11.                   ├─base::stop("Map server returned error code ", httr::status_code(img_res))
   12.                   │ └─base::.makeMessage(..., domain = domain)
   13.                   │   └─base::lapply(list(...), as.character)
   14.                   └─httr::status_code(img_res)
  
  [ FAIL 3 | WARN 21 | SKIP 22 | PASS 22 ]
  Error: Test failures
  Execution halted