(v3.0.1.9135) Fix get_mo_source() removing the mo_source file at the default location, returning the wrong mo_source, and throwing an error after the original file was moved, and run the unit tests in CI also in a real interactive session and with a user setup, a Dutch locale, and CLSI as default guideline, with tests that no longer assume an English locale or EUCAST

This commit is contained in:
dr. M.S. (Matthijs) Berends committed 2026-10-14 23:34:45 +02:00
1 parent 4be7352843
commit 8b01bcb23c
16 files changed
+360 -38

No files matched your search

+16 -8
View File
@@ -35,21 +35,25 @@ test_that("test-antibiogram.R", {
ab0 <- antibiogram(example_isolates)
# the column names of ab1 to ab6 and ab8 to ab9 are tested in English, which must also hold on systems in another language
ab1 <- antibiogram(example_isolates,
antimicrobials = c(aminoglycosides(), carbapenems())
antimicrobials = c(aminoglycosides(), carbapenems()),
language = "en"
)
ab2 <- antibiogram(example_isolates,
antimicrobials = aminoglycosides(),
ab_transform = "atc",
mo_transform = "gramstain"
mo_transform = "gramstain",
language = "en"
)
ab3 <- antibiogram(example_isolates,
antimicrobials = carbapenems(),
ab_transform = "ab",
mo_transform = "name",
formatting_type = 1
formatting_type = 1,
language = "en"
)
expect_inherits(ab1, "antibiogram")
@@ -65,7 +69,8 @@ test_that("test-antibiogram.R", {
# combined antibiogram yield higher empiric coverage
ab4 <- antibiogram(example_isolates,
antimicrobials = c("TZP", "TZP+TOB", "TZP+GEN"),
mo_transform = "gramstain"
mo_transform = "gramstain",
language = "en"
)
ab5 <- antibiogram(example_isolates,
@@ -73,7 +78,8 @@ test_that("test-antibiogram.R", {
mo_transform = "gramstain",
ab_transform = "name",
sep = " & ",
add_total_n = FALSE
add_total_n = FALSE,
language = "en"
)
expect_inherits(ab4, "antibiogram")
@@ -87,7 +93,8 @@ test_that("test-antibiogram.R", {
ab6 <- antibiogram(example_isolates,
antimicrobials = c(aminoglycosides(), carbapenems()),
syndromic_group = "ward",
ab_transform = NULL
ab_transform = NULL,
language = "en"
)
# with a custom language, though this will be determined automatically
@@ -112,7 +119,8 @@ test_that("test-antibiogram.R", {
# the data set could contain a filter for e.g. respiratory specimens
ab8 <- suppressWarnings(antibiogram(example_isolates,
antimicrobials = c("TZP", "TZP+TOB", "TZP+GEN"),
wisca = TRUE
wisca = TRUE,
language = "en"
))
expect_inherits(ab8, "antibiogram")
@@ -125,7 +133,7 @@ test_that("test-antibiogram.R", {
expect_warning(
ab9 <- example_isolates %>%
group_by(ward, gender) %>%
wisca(antimicrobials = c("TZP", "TZP+TOB", "TZP+GEN"))
wisca(antimicrobials = c("TZP", "TZP+TOB", "TZP+GEN"), language = "en")
)
expect_equal(colnames(ab9), c("ward", "gender", "Piperacillin/tazobactam", "Piperacillin/tazobactam + Gentamicin", "Piperacillin/tazobactam + Tobramycin"))
}