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

(v2.1.1.9257) adjust unit tests

This commit is contained in:
2025-04-27 09:58:19 +02:00
parent f340e257fa
commit d2b3937a90
4 changed files with 10 additions and 13 deletions

View File

@ -53,7 +53,7 @@ test_that("test-antibiogram.R", {
expect_inherits(ab2, "antibiogram")
expect_inherits(ab3, "antibiogram")
expect_equal(colnames(ab1), c("Pathogen", "Amikacin", "Gentamicin", "Imipenem", "Kanamycin", "Meropenem", "Tobramycin"))
expect_equal(colnames(ab2), c("Pathogen (N min-max)", "J01GB01", "J01GB03", "J01GB04", "J01GB06"))
expect_equal(colnames(ab2), c("Pathogen", "J01GB01", "J01GB03", "J01GB04", "J01GB06"))
expect_equal(colnames(ab3), c("Pathogen", "IPM", "MEM"))
expect_equal(ab3$MEM, c(52, NA, 100, 100, NA))
@ -96,14 +96,13 @@ test_that("test-antibiogram.R", {
syndromic_group = ifelse(ex1$ward == "ICU",
"IC", "Geen IC"
),
language = "nl",
add_total_n = TRUE
language = "nl"
)
expect_inherits(ab6, "antibiogram")
expect_inherits(ab7, "antibiogram")
expect_equal(colnames(ab6), c("Syndromic Group", "Pathogen", "AMK", "GEN", "IPM", "KAN", "MEM", "TOB"))
expect_equal(colnames(ab7), c("Syndroomgroep", "Pathogeen (N min-max)", "Amikacine", "Gentamicine", "Tobramycine"))
expect_equal(colnames(ab7), c("Syndroomgroep", "Pathogeen", "Amikacine", "Gentamicine", "Tobramycine"))
# Weighted-incidence syndromic combination antibiogram (WISCA) ---------

View File

@ -325,15 +325,13 @@ test_that("test-sir.R", {
expect_message(as.sir(data.frame(
mo = "E. coli",
NIT = c("<= 2", 32),
uti = TRUE,
info = TRUE
)))
uti = TRUE
), info = TRUE))
expect_message(as.sir(data.frame(
mo = "E. coli",
NIT = c("<= 2", 32),
specimen = c("urine", "blood"),
info = TRUE
)))
specimen = c("urine", "blood")
), info = TRUE))
# SDD vs I in CLSI 2024
expect_identical(