tests/testthat/test_summary.R

library("testthat")
library("neotoma2")

test_that("`datasets()`", {
  skip_on_cran()
  dls <- get_sites() %>%
    get_downloads()
  sumDl <- summary(dls)
  ids <- getids(dls)
  dss <- datasets(dls)
  cus <- collunits(dls)
  testthat::expect_identical(sum(sumDl$n_datasets), nrow(ids))
  testthat::expect_identical(length(unique(sumDl$siteid)), length(dls))
  testthat::expect_true(all(sumDl$collunit_name %in% cus$handle))
  testthat::expect_true(all(cus$handle %in% sumDl$collunit_name))
})

Try the neotoma2 package in your browser

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

neotoma2 documentation built on Dec. 6, 2025, 5:07 p.m.