tests/testthat/test-sampling.R

context("test-sampling")

test_that("phylogeny works", {
  skip_if_offline()
  spp <- c("Acanthurus achilles","Acanthurus auranticavus","Acanthurus bahianus")
  expect_equal(3, ape::Ntip(fishtree_phylogeny(species = spp)))
  expect_is(fishtree_phylogeny(species = spp), "phylo")
})

test_that("warn on extra species", {
  skip_if_offline()
  spp <- c("Acanthurus achilles","Acanthurus auranticavus","Acanthurus bahianus", "Nonexistant")
  expect_warning(fishtree_phylogeny(species = spp), "only found 3 species")
})


test_that("alignment single species works", {
  skip_if_offline()
  skip_on_cran() # Takes a long time
  spp <- "Abalistes_stellaris"
  expect_s3_class(fishtree_alignment(species = spp), "DNAbin")
})

Try the fishtree package in your browser

Any scripts or data that you put into this service are public.

fishtree documentation built on Jan. 31, 2021, 1:06 a.m.