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

(v1.4.0.9045) unit tests

This commit is contained in:
2020-12-25 00:06:11 +01:00
parent df37584189
commit 291f802be3
15 changed files with 45 additions and 49 deletions

View File

@ -152,12 +152,6 @@ test_that("first isolates work", {
require("dplyr")
# look for columns itself
expect_message(first_isolate(example_isolates))
expect_message(first_isolate(example_isolates %>%
mutate(mo = as.character(mo)) %>%
left_join_microorganisms()))
# if mo is not an mo class, result should be the same
expect_identical(example_isolates %>%
mutate(mo = as.character(mo)) %>%

View File

@ -52,6 +52,7 @@ test_that("proportions works", {
0.9382647,
tolerance = 0.0001)
library(dplyr)
# percentages
expect_equal(example_isolates %>%
group_by(hospital_id) %>%
@ -79,7 +80,7 @@ test_that("proportions works", {
expect_warning(proportion_R(as.character(example_isolates$AMC)))
expect_warning(proportion_S(as.character(example_isolates$AMC)))
expect_warning(proportion_S(as.character(example_isolates$AMC,
example_isolates$GEN)))
example_isolates$GEN)))
expect_warning(n_rsi(as.character(example_isolates$AMC,
example_isolates$GEN)))
expect_equal(suppressWarnings(n_rsi(as.character(example_isolates$AMC,