Skip to content

Commit

Permalink
fixed skip on cran usage in new tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
jooolia committed Jul 16, 2023
1 parent 3e3e0d3 commit 1a604ae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 0 additions & 2 deletions tests/testthat/test-allgensnp.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ test_that("allgensnps returns the proper dataframe", {

## for testing it is useful to be able to only get a subset of users

skip_on_cran()

vcr::use_cassette("allgensnp_error", {
expect_error(dat <- allgensnp(snp = "rs486907",
usersubset = "1-8"))
Expand Down
14 changes: 8 additions & 6 deletions tests/testthat/test-users.R
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
test_that("getting users from opensnp works", {
skip_on_cran()
vcr::use_cassette("users", {
data <- users(df = TRUE)
})
expect_equal(ncol(data[[1]]), 5)
expect_equal(nrow(data[[1]]), 5476)
})


vcr::use_cassette("users_badgateway", {
test_that("fail with 502, bad gateway, when getting opensnp users", {
expect_error(users(df = TRUE))
test_that("getting users with bad gateway errors out", {
skip_on_cran()
vcr::use_cassette("users_badgateway", {
test_that("fail with 502, bad gateway, when getting opensnp users", {
expect_error(users(df = TRUE))
})
})

})
})

0 comments on commit 1a604ae

Please sign in to comment.