tests/testthat/test-info.R

context("info")

test_that("info functions work", {
  skip_on_cran()
  skip_on_ci()

  res <- nhd_plus_info(vpu = 4, component = "NHDSnapshot", dsn = "NHDWaterbody")
  expect_equal(length(unique(as.data.frame(res)$Var2)),
                      13)

  nhd_get("DC")
  res <- nhd_info("DC", "NHDWaterbody")
  expect_equal(length(unique(as.data.frame(res)$Var2)),
                      14)

  # works with dbf layers
  nhd_plus_get(1, "NHDPlusAttributes")
  expect_equal(
    class(nhd_plus_info(vpu = 1, component = "NHDPlusAttributes", dsn = "PlusFlow")),
    "table")
})

Try the nhdR package in your browser

Any scripts or data that you put into this service are public.

nhdR documentation built on Aug. 12, 2023, 9:06 a.m.