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

(v1.3.0) skip more CRAN tests

This commit is contained in:
2020-07-31 10:50:08 +02:00
parent c8edcb7439
commit c5f7294381
45 changed files with 66 additions and 65 deletions

View File

@ -22,7 +22,7 @@
context("data.R")
test_that("data sets are valid", {
skip_on_cran()
expect_true(check_dataset_integrity()) # in misc.R
# IDs should always be unique
@ -39,10 +39,10 @@ test_that("data sets are valid", {
expect_false(any(is.na(microorganisms.codes$code)))
expect_false(any(is.na(microorganisms.codes$mo)))
expect_false(any(microorganisms.translation$mo_old %in% microorganisms$mo))
# 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 seq_len(length(datasets))) {
@ -52,6 +52,8 @@ test_that("data sets are valid", {
})
test_that("creation of data sets is valid", {
skip_on_cran()
df <- create_MO_lookup()
expect_lt(nrow(df[which(df$prevalence == 1), ]), nrow(df[which(df$prevalence == 2), ]))
expect_lt(nrow(df[which(df$prevalence == 2), ]), nrow(df[which(df$prevalence == 3), ]))
@ -59,16 +61,18 @@ test_that("creation of data sets is valid", {
"kingdom", "phylum", "class", "order", "family", "genus", "species", "subspecies",
"rank", "ref", "species_id", "source", "prevalence", "snomed",
"kingdom_index", "fullname_lower", "g_species") %in% colnames(df)))
olddf <- create_MO.old_lookup()
expect_true(all(c("fullname", "fullname_new", "ref", "prevalence",
"fullname_lower", "g_species") %in% colnames(olddf)))
})
test_that("CoL version info works", {
expect_identical(class(catalogue_of_life_version()),
c("catalogue_of_life_version", "list"))
skip_on_cran()
expect_identical(class(catalogue_of_life_version()),
c("catalogue_of_life_version", "list"))
expect_output(print(catalogue_of_life_version()))
})