1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-09 22:22:03 +02:00

(v1.6.0.9028) new unit test flow

This commit is contained in:
2021-05-13 22:44:11 +02:00
parent 5b9fb8daf4
commit 9ed2f6490f
31 changed files with 108 additions and 99 deletions

View File

@ -150,7 +150,7 @@ test_that("as.mo works", {
expect_identical(as.character(as.mo("S. salivarius", Lancefield = FALSE)), "B_STRPT_SLVR")
expect_identical(as.character(as.mo("S. salivarius", Lancefield = TRUE)), "B_STRPT_GRPK") # group K
if (require("dplyr")) {
if (suppressWarnings(require("dplyr"))) {
# select with one column
expect_identical(
example_isolates[1:10, ] %>%
@ -282,8 +282,10 @@ test_that("as.mo works", {
expect_equal(suppressWarnings(as.character(as.mo(c("yeasts", "fungi")))),
c("F_YEAST", "F_FUNGUS"))
# print tibble
expect_output(print(tibble(mo = as.mo("B_ESCHR_COLI"))))
if (suppressWarnings(require("dplyr"))) {
# print tibble
expect_output(print(tibble(mo = as.mo("B_ESCHR_COLI"))))
}
# assigning and subsetting
x <- example_isolates$mo
@ -299,7 +301,7 @@ test_that("as.mo works", {
c("B_ESCHR_COLI", NA))
# frequency tables
if (require("cleaner")) {
if (suppressWarnings(require("cleaner"))) {
expect_s3_class(cleaner::freq(example_isolates$mo), "freq")
}