1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-11 23:42:02 +02:00

(v1.6.0.9028) new unit test flow

This commit is contained in:
2021-05-13 22:44:11 +02:00
parent 5b9fb8daf4
commit 9ed2f6490f
31 changed files with 108 additions and 99 deletions

View File

@ -51,15 +51,17 @@ test_that("looking up ab columns works", {
expect_warning(generate_warning_abs_missing(c("AMP", "AMX"), any = TRUE))
expect_warning(get_column_abx(example_isolates, hard_dependencies = "FUS"))
expect_message(get_column_abx(example_isolates, soft_dependencies = "FUS"))
expect_warning(get_column_abx(dplyr::rename(example_isolates, thisone = AMX), amox = "thisone", tmp = "thisone", verbose = TRUE))
expect_warning(get_column_abx(dplyr::rename(example_isolates, thisone = AMX), amox = "thisone", tmp = "thisone", verbose = FALSE))
if (suppressWarnings(require("dplyr"))) {
expect_warning(get_column_abx(rename(example_isolates, thisone = AMX), amox = "thisone", tmp = "thisone", verbose = TRUE))
expect_warning(get_column_abx(rename(example_isolates, thisone = AMX), amox = "thisone", tmp = "thisone", verbose = FALSE))
}
})
test_that("looking up ab columns works", {
skip_on_cran()
# we rely on "grouped_tbl" being a class of grouped tibbles, so implement a test that checks for this:
if (require("dplyr")) {
if (suppressWarnings(require("dplyr"))) {
expect_true(is_null_or_grouped_tbl(example_isolates %>% group_by(hospital_id)))
}