tests/testthat/test-multimediaClient-misc.R

source("setup-vars.R")

context("Testing miscellaneous multimedia endpoints")

test_that("count works", {
  res <- mc$count()
  expect_true(is.numeric(res$content))
  expect_true(res$content > 0)
})

test_that("getDistinctValues works", {
  ## check for all paths
  paths <- mc$get_paths()$content
  ## fielddata not supported for geoShape, remove it
  paths <- paths[paths != "gatheringEvents.siteCoordinates.geoShape"]
  for (p in paths) {
    res <- mc$get_distinct_values(p)
    ## check if we get list back
    expect_is(res$content, "list")
  }
  ## method should give a warning if field is not found
  expect_warning(mc$get_distinct_values("XX"))
})
naturalis/nbaR documentation built on Nov. 12, 2023, 4:47 p.m.