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

set_mo_source

This commit is contained in:
2019-01-21 15:53:01 +01:00
parent c6c3088e9f
commit 46dcc7e2e8
36 changed files with 1134 additions and 261 deletions

View File

@ -194,7 +194,7 @@ test_that("as.mo works", {
expect_equal(suppressMessages(as.character(as.mo("Escherichia blattae"))), "B_SHMWL_BLA")
# - Didymosphaeria spartinae (unprevalent)
expect_warning(suppressMessages(as.mo("D spartin", allow_uncertain = TRUE)))
# - was renames to Leptosphaeria obiones
# - was renamed to Leptosphaeria obiones
expect_equal(suppressWarnings(suppressMessages(as.character(as.mo("D spartin", allow_uncertain = TRUE)))),
"F_LPTSP_OBI")
@ -205,15 +205,15 @@ test_that("as.mo works", {
# predefined reference_df
expect_equal(as.character(as.mo("TestingOwnID",
reference_df = data.frame(a = "TestingOwnID", b = "B_ESCHR_COL"))),
reference_df = data.frame(mycol = "TestingOwnID", mo = "B_ESCHR_COL"))),
"B_ESCHR_COL")
expect_equal(as.character(as.mo(c("TestingOwnID", "E. coli"),
reference_df = data.frame(a = "TestingOwnID", b = "B_ESCHR_COL"))),
reference_df = data.frame(mycol = "TestingOwnID", mo = "B_ESCHR_COL"))),
c("B_ESCHR_COL", "B_ESCHR_COL"))
expect_warning(as.mo("TestingOwnID", reference_df = NULL))
expect_error(as.mo("E. coli", reference_df = data.frame(a = "TestingOwnID")))
expect_error(as.mo("E. coli", reference_df = data.frame(mycol = "TestingOwnID")))
# combination of existing mo and certe
# combination of existing mo and other code
expect_identical(as.character(as.mo(c("B_ESCHR_COL", "ESCCOL"))),
c("B_ESCHR_COL", "B_ESCHR_COL"))