Author: Michael R. Crusoe <michael.crusoe@gmail.com>
Description: delete a test that depends on an unavailable external URL
Forwarded: https://github.com/Bioconductor/BiocFileCache/issues/20
--- a/tests/testthat/test_BiocFileCache_class.R
+++ b/tests/testthat/test_BiocFileCache_class.R
@@ -453,9 +453,7 @@ test_that("bfcneedsupdate works", {
     # test expires and last modified not available
     link = "http://httpbin.org/get"
     bfcupdate(bfc, rid3, fpath=link, ask=FALSE)
-    expect_true(is.na(bfcneedsupdate(bfc, rid3)))
     expect_true(is.na(as.data.frame(bfcinfo(bfc,rid3))$last_modified_time))
-    expect_true(is.na(as.data.frame(bfcinfo(bfc,rid3))$expires))
 
     # remove those that aren't web
     expect_identical(
@@ -500,38 +498,6 @@ test_that("bfcneedsupdate works", {
     expect_true(bfcneedsupdate(bfc, rid3))
 })
 
-test_that("bfcdownload works", {
-    response <- .biocfilecache_flags$set_ask_response(FALSE)
-
-    time1 <- file.info(.sql_get_rpath(bfc, rid3))[["ctime"]]
-    temp <- bfcdownload(bfc, rid3, ask=TRUE)
-    time2 <- file.info(.sql_get_rpath(bfc, rid3))[["ctime"]]
-    expect_identical(time1, time2)
-
-    temp <- bfcdownload(bfc, rid3, ask=FALSE)
-    time3 <- file.info(.sql_get_rpath(bfc, rid3))[["ctime"]]
-    expect_true(time1 < time3)
-    expect_error(bfcdownload(bfc, rid1))
-
-    url <- "http://bioconductor.org/packages/stats/bioc/BiocFileCache/BiocFileCache_stats.tab"
-    headFile <-
-    function(url, file)
-        {
-            dat <- readLines(url)
-            dat <- head(dat, n=3L)
-            writeLines(dat, file)
-            TRUE
-        }
-    rid <- names(bfcadd(bfc, rname="testFun", fpath=url, download=FALSE))
-    temp <- bfcdownload(bfc, rid, FUN=headFile)
-    file <- readLines(temp)
-    expect_identical(length(file), 3L)
-
-    expect_error(bfcdownload(bfc, rid, ask=FALSE, FUN=rnorm))
-
-    .biocfilecache_flags$set_ask_response(response)
-})
-
 test_that("exportbfc and importbfc works",{
 
     bfc <- BiocFileCache(tempfile(), ask = FALSE)
--- a/tests/testthat/test_httr.R
+++ b/tests/testthat/test_httr.R
@@ -5,7 +5,6 @@ test_that("internal .httr_get_cache_info
     # example neither
     url <- "http://httpbin.org/get"
     info <- .httr_get_cache_info(url)
-    expect_true(all(is.na(info)))
     expect_identical(length(info), 3L)
     expect_identical(names(info), c("etag", "modified", "expires"))
 
--- a/tests/testthat/test_sql.R
+++ b/tests/testthat/test_sql.R
@@ -131,10 +131,5 @@ test_that(".sql_add_resource() changes r
     bfname <- basename(url)
     bfname <- curl::curl_escape(bfname)
     rpath <- sprintf("%s_%s%s", rpath, bfname, ext)
-    id1 <- bfcadd(bfc, url)
-    expect_identical(unname(.sql_get_rname(bfc, names(id1))), url)
-    expect_identical(unname(.sql_get_fpath(bfc, names(id1))), url)
-    # can't do identical because different random identifier
-    expect_true(grepl(bfname, basename(unname(.sql_get_rpath(bfc, names(id1))))))
 
 })
