You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
opensensmapR/tests/testthat/test_counts.R

18 lines
376 B
R

context("counts")
check_api <- function() {
code <- NA
try(code <- httr::status_code(httr::GET(osem_endpoint())))
if (is.na(code)) skip("API not available")
}
test_that("counts can be retrieved as a list of numbers", {
check_api()
counts <- osem_counts()
expect_true(is.list(counts))
expect_true(is.numeric(unlist(counts)))
expect_length(counts, 3)
})