Marc Kupietz | 6ddece4 | 2023-12-18 17:02:36 +0100 | [diff] [blame] | 1 | test_that("textMetadata works", { |
| 2 | skip_if_offline() |
Marc Kupietz | fabc239 | 2025-02-07 17:03:06 +0100 | [diff] [blame^] | 3 | m <- new("KorAPConnection", accessToken = NULL) %>% textMetadata(c("WUD17/B96/57558", "WUD17/A97/08541")) |
Marc Kupietz | 6ddece4 | 2023-12-18 17:02:36 +0100 | [diff] [blame] | 4 | expect("textType" %in% names(m), "textMetadata value should contain a textType column") |
| 5 | }) |
| 6 | |
| 7 | |
| 8 | test_that("textMetadata works for unknown text sigles", { |
| 9 | skip_if_offline() |
Marc Kupietz | fabc239 | 2025-02-07 17:03:06 +0100 | [diff] [blame^] | 10 | m <- new("KorAPConnection", accessToken = NULL) %>% textMetadata(c("WUD17/B96/57558", "unknownsigle")) |
Marc Kupietz | 6ddece4 | 2023-12-18 17:02:36 +0100 | [diff] [blame] | 11 | expect("errors" %in% names(m), "textMetadata should return an errors column if a text does not exist") |
| 12 | }) |
Marc Kupietz | 06e5b97 | 2024-12-07 17:22:06 +0100 | [diff] [blame] | 13 | |
| 14 | test_that("textMetadata works with list valued fields", { |
| 15 | skip_if_offline() |
Marc Kupietz | fabc239 | 2025-02-07 17:03:06 +0100 | [diff] [blame^] | 16 | m <- new("KorAPConnection", accessToken = NULL) %>% textMetadata("WUD17/B96/57558") |
Marc Kupietz | 06e5b97 | 2024-12-07 17:22:06 +0100 | [diff] [blame] | 17 | expect("staat-gesellschaft\\tbiographien-interviews" == m$textClass[1], "multiple text classes / domnains should be tab separated") |
| 18 | }) |