Skip to content

Commit

Permalink
importBugSigDB tests: check for different dimensions depending on source
Browse files Browse the repository at this point in the history
  • Loading branch information
lgeistlinger committed Oct 13, 2024
1 parent 63efc0c commit 5b35f87
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: bugsigdbr
Version: 1.11.1
Version: 1.11.2
Title: R-side access to published microbial signatures from BugSigDB
Authors@R: c(
person(given = "Ludwig",
Expand Down
12 changes: 6 additions & 6 deletions tests/testthat/test-importBugSigDB.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
checkImport <- function(bsdb, url)
checkImport <- function(bsdb, url, nrows = 2000)
{
expect_true(is.data.frame(bsdb))
expect_gt(nrow(bsdb), 2000)
expect_gt(nrow(bsdb), nrows)
expect_gt(ncol(bsdb), 40)
expect_true(all(c("Study", "Study design", "PMID") %in% colnames(bsdb)[1:4]))

Expand All @@ -18,15 +18,15 @@ checkImport <- function(bsdb, url)
}

test_that("importBugSigDB from Zenodo", {
bsdb <- bugsigdbr::importBugSigDB(version = "10.5281/zenodo.5819260", cache = FALSE)
url <- "https://zenodo.org/record/5819260/files/full_dump.csv"
checkImport(bsdb, url)
bsdb <- bugsigdbr::importBugSigDB(version = "10.5281/zenodo.10627578", cache = FALSE)
url <- "https://zenodo.org/record/10627578/files/full_dump.csv"
checkImport(bsdb, url, nrows = 3500)
})

test_that("importBugSigDB from the edge (devel)", {
bsdb <- bugsigdbr::importBugSigDB(version = "devel", cache = FALSE)
url <- "https://tinyurl.com/3nvzm3fx"
checkImport(bsdb, url)
checkImport(bsdb, url, nrows = 5500)
})

test_that("importBugSigDB from github hash", {
Expand Down

0 comments on commit 5b35f87

Please sign in to comment.