Skip to content

Commit

Permalink
suppressmessages about api keys in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sckott committed Jul 6, 2015
1 parent 142c7fd commit 27fc9e0
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 22 deletions.
14 changes: 7 additions & 7 deletions tests/testthat/test-comm2sci.R
@@ -1,16 +1,16 @@
# tests for comm2sci fxn in taxize
context("comm2sci")

tt <- comm2sci(commnames='black bear')
uu <- comm2sci(commnames='annual blue grass', db='tropicos')
temp1 <- comm2sci(commnames=c('black bear','roe deer'), db='eol')
temp2 <- comm2sci(commnames='black bear', db='tropicos')
temp3 <- comm2sci(commnames=c('black bear','roe deer'), db='eol')
tt <- suppressMessages(comm2sci(commnames='black bear'))
uu <- suppressMessages(comm2sci(commnames='annual blue grass', db='tropicos'))
temp1 <- suppressMessages(comm2sci(commnames=c('black bear','roe deer'), db='eol'))
temp2 <- suppressMessages(comm2sci(commnames='black bear', db='tropicos'))
temp3 <- suppressMessages(comm2sci(commnames=c('black bear','roe deer'), db='eol'))

test_that("comm2sci returns the correct value", {
expect_that(names(tt), equals('black bear'))
expect_that(names(uu), equals('annual blue grass'))
expect_identical(comm2sci(commnames='bear', db='itis', itisby = "asfasdf")[[1]], character(0))
expect_identical(suppressMessages(comm2sci(commnames='bear', db='itis', itisby = "asfasdf"))[[1]], character(0))
expect_named(temp2)
expect_named(temp3)
})
Expand All @@ -20,7 +20,7 @@ test_that("comm2sci returns the correct class", {
expect_that(tt[[1]], is_a("character"))
expect_that(uu, is_a("list"))
expect_that(uu[[1]], is_a("character"))
expect_is(comm2sci(commnames='black bear', db='itis', simplify = FALSE)[[1]], "data.frame")
expect_is(suppressMessages(comm2sci(commnames='black bear', db='itis', simplify = FALSE))[[1]], "data.frame")
})

# test_that("errors when expected", {
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-eol_dataobjects.R
@@ -1,7 +1,7 @@
# tests for eol_dataobjects fxn in taxize
context("eol_dataobjects")

temp <- eol_dataobjects(id="d72801627bf4adf1a38d9c5f10cc767f", verbose=FALSE)
temp <- suppressMessages(eol_dataobjects(id="d72801627bf4adf1a38d9c5f10cc767f", verbose=FALSE))

test_that("eol_dataobjects returns the correct class", {
expect_is(temp, "list")
Expand Down
10 changes: 5 additions & 5 deletions tests/testthat/test-eol_pages.R
@@ -1,14 +1,14 @@
# tests for eol_pages fxn in taxize
context("eol_pages")

pageid <- eol_search('Pomatomus')$pageid[1]
pageid2 <- eol_search('Helianthus')$pageid[1]
pageid <- suppressMessages(eol_search('Pomatomus'))$pageid[1]
pageid2 <- suppressMessages(eol_search('Helianthus'))$pageid[1]

test_that("eol_pages returns the correct value", {
expect_that(eol_pages(taxonconceptID=pageid)$scinames[1,1], equals(52595367))
expect_that(eol_pages(taxonconceptID=pageid2)$scinames[1,1], equals(52926469 ))
expect_that(suppressMessages(eol_pages(taxonconceptID=pageid))$scinames[1,1], equals(52595367))
expect_that(suppressMessages(eol_pages(taxonconceptID=pageid2))$scinames[1,1], equals(52926469 ))
})

test_that("eol_pages returns the correct class", {
expect_that(eol_pages(taxonconceptID=pageid)$scinames, is_a("data.frame"))
expect_that(suppressMessages(eol_pages(taxonconceptID=pageid))$scinames, is_a("data.frame"))
})
2 changes: 1 addition & 1 deletion tests/testthat/test-plantminer.R
Expand Up @@ -2,7 +2,7 @@
context("plantminer")

plants <- c("Myrcia lingua", "Myrcia bella")
df <- plantminer(plants, verbose=FALSE)
df <- suppressMessages(plantminer(plants, verbose=FALSE))

test_that("plantminer returns the correct value", {
expect_that(as.character(df[1,1]), matches("Myrtaceae"))
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-tp_accnames.R
@@ -1,7 +1,7 @@
# tests for tp_accnames fxn in taxize
context("tp_accnames")

out <- tp_accnames(id = 25503923)
out <- suppressMessages(tp_accnames(id = 25503923))

test_that("tp_accnames returns the correct class", {
expect_that(out, is_a("list"))
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-tp_dist.R
@@ -1,7 +1,7 @@
# tests for tp_dist fxn in taxize
context("tp_dist")

tt <- tp_dist(id = 25509881)
tt <- suppressMessages(tp_dist(id = 25509881))

test_that("tp_dist returns the correct class", {
expect_that(tt, is_a("list"))
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-tp_refs.R
@@ -1,7 +1,7 @@
# tests for tp_refs fxn in taxize
context("tp_refs")

ttt <- tp_refs(id = 25509881)
ttt <- suppressMessages(tp_refs(id = 25509881))

test_that("tp_refs returns the correct class", {
expect_that(ttt, is_a("data.frame"))
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-tp_search.R
@@ -1,8 +1,8 @@
# tests for tp_search fxn in taxize
context("tp_search")

ttt <- tp_search(name = 'Poa annua')
uuu <- tp_search(name = 'stuff things')
ttt <- suppressMessages(tp_search(name = 'Poa annua'))
uuu <- suppressMessages(tp_search(name = 'stuff things'))

test_that("tp_search returns the correct class", {
expect_that(ttt, is_a("data.frame"))
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-tp_summary.R
@@ -1,7 +1,7 @@
# tests for tp_summary fxn in taxize
context("tp_summary")

dat <- tp_summary(id = 25509881)
dat <- suppressMessages(tp_summary(id = 25509881))

test_that("tp_summary returns the correct value", {
expect_that(names(dat)[[1]], matches(".id"))
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-tp_synonyms.R
@@ -1,7 +1,7 @@
# tests for tp_synonyms fxn in taxize
context("tp_synonyms")

dat <- tp_synonyms(id = 25509881)
dat <- suppressMessages(tp_synonyms(id = 25509881))

test_that("tp_synonyms returns the correct value", {
expect_that(names(dat)[[1]], matches("accepted"))
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-ubio_classification.R
Expand Up @@ -2,7 +2,7 @@

context("ubio_classification")

tt <- ubio_classification(hierarchiesID = 2483153)
tt <- suppressMessages(ubio_classification(hierarchiesID = 2483153))


test_that("ncbi_get_taxon_summary returns correct class and result", {
Expand Down

0 comments on commit 27fc9e0

Please sign in to comment.