Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2d93392
commit 3c74d9a
Showing
4 changed files
with
107 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# tests for ncbi_get_taxon_summary | ||
|
||
context("ncbi_children") | ||
|
||
tt <- ncbi_children(id = 4751) | ||
tt2 <- ncbi_children(id = 4751, out_type = 'uid') | ||
|
||
|
||
test_that("ncbi_childres returns correct class and result", { | ||
expect_is(tt, "list") | ||
expect_is(tt[[1]], "data.frame") | ||
expect_equal(ncol(tt[[1]]), 3) | ||
expect_is(tt1, "list") | ||
expect_is(tt1[[1]], "vector") | ||
expect_error(ncbi_children(name = 'Ilex', id = 4751)) | ||
expect_equal(ncbi_children(name = NA)[[1]], NA) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# tests for ncbi_get_taxon_summary | ||
|
||
context("ncbi_get_taxon_summary") | ||
|
||
|
||
tt <- ncbi_get_taxon_summary(c(4751)) | ||
tt2 <- ncbi_get_taxon_summary(NA) | ||
tt3 <- ncbi_get_taxon_summary(id = NULL) | ||
|
||
test_that("ncbi_get_taxon_summary returns correct class and result", { | ||
expect_is(tt, "data.frame") | ||
expect_equal(ncol(tt), 3) | ||
expect_equal(tt[1, 3], 'kingdom') | ||
expect_equal(tt2, NA) | ||
expect_equal(tt3, NULL) | ||
}) | ||
|
||
test_that("vascan_search returns the correct dimensions", { | ||
expect_equal(NCOL(aa[[1]]$matches[[1]]$taxonomicassertions), 7) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# tests for eol_ping fxn in taxize | ||
context("ping") | ||
|
||
test_that("col_ping returns the correct value", { | ||
expect_true(col_ping()) | ||
expect_false(col_ping(503)) | ||
expect_true(col_ping("content")) | ||
}) | ||
|
||
|
||
test_that("ncbi_ping returns the correct value", { | ||
expect_true(ncbi_ping()) | ||
expect_false(ncbi_ping(503)) | ||
expect_true(ncbi_ping("content")) | ||
}) | ||
|
||
test_that("trpicos_ping returns the correct value", { | ||
expect_true(tropicos_ping()) | ||
expect_false(tropicos_ping(503)) | ||
expect_true(tropicos_ping("content")) | ||
}) | ||
|
||
test_that("nbn_ping returns the correct value", { | ||
expect_true(nbn_ping()) | ||
expect_false(nbn_ping(503)) | ||
expect_true(nbn_ping("content")) | ||
}) | ||
|
||
test_that("gbif_ping returns the correct value", { | ||
expect_true(gbif_ping()) | ||
expect_false(gbif_ping(503)) | ||
expect_true(gbif_ping("content")) | ||
}) | ||
|
||
test_that("ubio_ping returns the correct value", { | ||
expect_true(ubio_ping()) | ||
expect_false(ubio_ping(503)) | ||
expect_true(ubio_ping("content")) | ||
}) | ||
|
||
test_that("bold_ping returns the correct value", { | ||
expect_true(bold_ping()) | ||
expect_false(bold_ping(503)) | ||
expect_true(bold_ping("content")) | ||
}) | ||
|
||
test_that("ipni_ping returns the correct value", { | ||
expect_true(ipni_ping()) | ||
expect_false(ipni_ping(503)) | ||
expect_true(ipni_ping("content")) | ||
}) | ||
|
||
test_that("vascan_ping returns the correct value", { | ||
expect_true(vascan_ping()) | ||
expect_false(vascan_ping(503)) | ||
expect_true(vascan_ping("content")) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# tests for ubio_classification | ||
|
||
context("ubio_classification") | ||
|
||
tt <- ubio_classification(hierarchiesID = 2483153) | ||
|
||
|
||
test_that("ncbi_get_taxon_summary returns correct class and result", { | ||
expect_is(tt, "list") | ||
expect_equal(length(tt), 5) | ||
expect_is(tt$data, "data.frame") | ||
expect_equal(ncol(tt$data), 8) | ||
}) |