tests/testthat/test-bfs_download_geodata.R

test_that("bfs_download_geodata() works", {
  if (!curl::has_internet()) {
    skip("No internet connection")
  }
  tmp <- tempdir()
  catalog_geodata <- BFS::bfs_get_catalog_geodata(include_metadata = FALSE)
  asset_path <- BFS::bfs_download_geodata(collection_id = catalog_geodata$collection_id[1], output_dir = tmp)
  expect_true(file.exists(asset_path[1]))
})
test_that("bfs_download_geodata() fails with missing arguments", {
  if (!curl::has_internet()) {
    skip("No internet connection")
  }
  expect_error(bfs_download_geodata())
})
lgnbhl/bfsdata documentation built on March 5, 2024, 8:15 a.m.