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

breakpoints UTI interpretation fix

This commit is contained in:
2023-07-10 13:41:52 +02:00
parent 3829311dd3
commit 70c601ca11
28 changed files with 605 additions and 150 deletions

View File

@ -106,7 +106,7 @@ expect_identical(mo_oxygen_tolerance(c("Klebsiella pneumoniae", "Clostridioides
c("aerobe", "anaerobe"))
expect_equal(as.character(table(mo_pathogenicity(example_isolates$mo))),
c("1561", "422", "1", "16"))
c("1874", "109", "1", "16"))
expect_equal(mo_ref("Escherichia coli"), "Castellani et al., 1919")
expect_equal(mo_authors("Escherichia coli"), "Castellani et al.")
@ -129,9 +129,12 @@ for (l in AMR:::LANGUAGES_SUPPORTED[-1]) {
# test languages
expect_error(mo_gramstain("Escherichia coli", language = "UNKNOWN"))
dutch <- suppressWarnings(mo_name(microorganisms$fullname[which(microorganisms$fullname %unlike% "unknown|coagulase|Fungi|[(]class[)]|[{]")], language = "nl", keep_synonyms = TRUE)) # should be transformable to English again
expect_identical(suppressWarnings(mo_name(dutch, language = NULL, keep_synonyms = TRUE)),
microorganisms$fullname[which(microorganisms$fullname %unlike% "unknown|coagulase|Fungi|[(]class[)]|[{]")]) # gigantic test - will run ALL names
fullnames <- microorganisms$fullname[which(microorganisms$fullname %unlike% "unknown|coagulase|Fungi|[(]class[)]|[{]")]
to_dutch <- suppressWarnings(mo_name(fullnames, language = "nl", keep_synonyms = TRUE))
back_to_english <- suppressWarnings(mo_name(dutch, language = NULL, keep_synonyms = TRUE))
diffs <- paste0('"', fullnames[fullnames != back_to_english], '"', collapse = ", ")
expect_identical(fullnames, back_to_english, info = diffs) # gigantic test - will run ALL names
# manual property function
expect_error(mo_property("Escherichia coli", property = c("genus", "fullname")))