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

(v1.6.0.9030) new unit test flow

This commit is contained in:
2021-05-13 23:07:31 +02:00
parent c17acbe712
commit 9a381c8d18
16 changed files with 28 additions and 21 deletions

View File

@ -27,7 +27,10 @@
# able to install it. Yet, we want basic R CMD CHECK's in those R versions
# as well, so only run unit tests in later R versions:
if (require("testthat", warn.conflicts = FALSE)) {
library(testthat)
library(AMR)
# print non-base packages
print(as.data.frame(utils::installed.packages())[which(is.na(as.data.frame(utils::installed.packages())$Priority)),
"Version",
drop = FALSE])
test_check("AMR")
}

View File

@ -119,7 +119,7 @@ test_that("mdro works", {
pza = sample_rsi(),
MFX = sample_rsi(),
KAN = sample_rsi())
expect_gt(n_distinct(mdr_tb(x)), 2)
expect_gt(length(unique(mdr_tb(x))), 2)
# check the guideline by Magiorakos et al. (2012), the default guideline
stau <- data.frame(mo = c("S. aureus", "S. aureus", "S. aureus", "S. aureus"),

View File

@ -48,10 +48,12 @@ test_that("prediction of rsi works", {
info = TRUE)))
pdf(NULL) # prevent Rplots.pdf being created
expect_silent(plot(x))
expect_silent(ggplot_rsi_predict(x))
expect_silent(ggplot(x))
expect_error(ggplot_rsi_predict(example_isolates))
if (suppressWarnings(require("ggplot2"))) {
expect_silent(ggplot_rsi_predict(x))
expect_silent(ggplot(x))
expect_error(ggplot_rsi_predict(example_isolates))
}
expect_output(rsi_predict(x = subset(example_isolates, mo == "B_ESCHR_COLI"),
model = "binomial",
col_ab = "AMX",