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

(v0.7.0.9005) ab algorithm update

This commit is contained in:
2019-06-11 14:18:25 +02:00
parent f6c47c8c88
commit 8f674e19bb
36 changed files with 274 additions and 248 deletions

View File

@ -24,12 +24,17 @@ context("data.R")
test_that("data sets are valid", {
# IDs should always be unique
expect_identical(nrow(antibiotics), length(unique(antibiotics$ab)))
expect_identical(class(antibiotics$ab), "ab")
expect_identical(nrow(microorganisms), length(unique(microorganisms$mo)))
expect_identical(class(microorganisms$mo), "mo")
# check cross table reference
expect_true(all(microorganisms.codes$mo %in% microorganisms$mo))
# there should be no diacritics (i.e. non ASCII) characters in the datasets
# antibiotic names must always be coercible to their original AB code
expect_identical(antibiotics$ab, as.ab(antibiotics$name))
# there should be no diacritics (i.e. non ASCII) characters in the datasets (CRAN policy)
datasets <- data(package = "AMR", envir = asNamespace("AMR"))$results[, "Item"]
for (i in 1:length(datasets)) {
dataset <- get(datasets[i], envir = asNamespace("AMR"))

View File

@ -33,10 +33,13 @@ test_that("mo_property works", {
expect_equal(mo_fullname("E. coli"), "Escherichia coli")
expect_equal(mo_name("E. coli"), "Escherichia coli")
expect_equal(mo_type("E. coli", language = "en"), "Bacteria")
expect_equal(mo_gramstain("E. coli", language = "en"), "Gram negative")
expect_equal(mo_gramstain("E. coli", language = "en"), "Gram-negative")
expect_equal(class(mo_taxonomy("E. coli")), "list")
expect_equal(names(mo_taxonomy("E. coli")), c("kingdom", "phylum", "class", "order",
"family", "genus", "species", "subspecies"))
expect_equal(names(mo_info("E. coli")), c("kingdom", "phylum", "class", "order",
"family", "genus", "species", "subspecies",
"url", "ref"))
expect_equal(mo_ref("E. coli"), "Castellani et al., 1919")
expect_equal(mo_authors("E. coli"), "Castellani et al.")