tests/testthat/test-create_ncbi_basic_tax_dataframe.R

test_that("it creates DataFrame", {
  create_ncbi_basic_tax_dataframe("9606")%>%
    expect_s3_class("data.frame")
})
test_that("it returns correct values ", {
  create_ncbi_basic_tax_dataframe("9606", c("kingdom"))%>%
    dplyr::pull("kingdom")%>%
    expect_equal("Metazoa")
  create_ncbi_basic_tax_dataframe("9606", c("kingdom","no_existo"))%>%
    dplyr::pull("no_existo")%>%
    expect_error()

})

test_that("it allows vectorization", {
  create_ncbi_basic_tax_dataframe(c("9606", "9544"))%>%
    dplyr::pull("species")%>%
    expect_equal(c("Homo sapiens", "Macaca mulatta"))
})
currocam/FascinRSCA documentation built on March 21, 2022, 6:29 a.m.