tests/testthat/test-textMetadata.R

test_that("textMetadata works", {
  skip_if_offline()
  m <- new("KorAPConnection", accessToken = NULL) %>% textMetadata(c("WUD17/B96/57558", "WUD17/A97/08541"))
  expect("textType" %in% names(m), "textMetadata value should contain a textType column")
})


test_that("textMetadata works for unknown text sigles", {
  skip_if_offline()
  m <- new("KorAPConnection", accessToken = NULL) %>% textMetadata(c("WUD17/B96/57558", "unknownsigle"))
  expect("errors" %in% names(m), "textMetadata should return an errors column if a text does not exist")
})

test_that("textMetadata works with list valued fields", {
  skip_if_offline()
  m <- new("KorAPConnection", accessToken = NULL) %>% textMetadata("WUD17/B96/57558")
  expect("staat-gesellschaft\\tbiographien-interviews" == m$textClass[1], "multiple text classes / domnains should be tab separated")
})

Try the RKorAPClient package in your browser

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

RKorAPClient documentation built on April 4, 2025, 1:02 a.m.