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

(v1.3.0.9025) optimalisation

This commit is contained in:
2020-09-19 15:15:57 +02:00
parent 2f0186ace2
commit a1411ddafc
15 changed files with 27 additions and 25 deletions

View File

@ -30,7 +30,8 @@ test_that("EUCAST rules work", {
c("if_mo_property", "like.is.one_of", "this_value",
"and_these_antibiotics", "have_these_values",
"then_change_these_antibiotics", "to_value",
"reference.rule", "reference.rule_group"))
"reference.rule", "reference.rule_group",
"reference.version"))
expect_error(suppressWarnings(eucast_rules(example_isolates, col_mo = "Non-existing")))
expect_error(eucast_rules(x = "text"))

View File

@ -38,10 +38,10 @@ test_that("mic works", {
expect_warning(as.mic("INVALID VALUE"))
# print plots
expect_success(x <- barplot(as.mic(c(1, 2, 4, 8))))
expect_success(x <- plot(as.mic(c(1, 2, 4, 8))))
expect_success(x <- print(as.mic(c(1, 2, 4, 8))))
pdf(NULL) # prevent Rplots.pdf being created
expect_silent(barplot(as.mic(c(1, 2, 4, 8))))
expect_silent(plot(as.mic(c(1, 2, 4, 8))))
expect_output(print(as.mic(c(1, 2, 4, 8))))
expect_equal(summary(as.mic(c(2, 8))),
structure(c("Class" = "mic",

View File

@ -35,8 +35,9 @@ test_that("prediction of rsi works", {
expect_true(AMX_R[3] < AMX_R[20])
x <- resistance_predict(example_isolates, col_ab = "AMX", year_min = 2010, model = "binomial")
expect_success(y <- plot(x))
expect_success(y <- ggplot_rsi_predict(x))
pdf(NULL) # prevent Rplots.pdf being created
expect_silent(plot(x))
expect_silent(ggplot_rsi_predict(x))
expect_error(ggplot_rsi_predict(example_isolates))
library(dplyr)

View File

@ -28,10 +28,10 @@ test_that("rsi works", {
expect_true(as.rsi("I") < as.rsi("R"))
expect_true(is.rsi(as.rsi("S")))
# print plots, should not raise errors
expect_success(x <- barplot(as.rsi(c("S", "I", "R"))))
expect_success(x <- plot(as.rsi(c("S", "I", "R"))))
expect_success(x <- print(as.rsi(c("S", "I", "R"))))
pdf(NULL) # prevent Rplots.pdf being created
expect_silent(barplot(as.rsi(c("S", "I", "R"))))
expect_silent(plot(as.rsi(c("S", "I", "R"))))
expect_output(print(as.rsi(c("S", "I", "R"))))
expect_equal(as.character(as.rsi(c(1:3))), c("S", "I", "R"))