Skip to content

Commit

Permalink
Minor testfix to check remote fetching.
Browse files Browse the repository at this point in the history
  • Loading branch information
LTLA committed Apr 22, 2024
1 parent 30d6b0b commit b0f71ba
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/testthat/test-fetch.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ test_that("fetchDirectory works as expected", {
write(file=file.path(rdir, "foo"), "more-bar")
rdir2 <- fetchDirectory("test/fetch/v2", registry=info$registry, url=info$url, cache=cache, forceRemote=TRUE)
expect_identical(rdir, rdir2)
expect_identical(readLines(file.path(rdir, "foo")), "more-bar")
expect_identical(readLines(file.path(rdir2, "foo")), "more-bar")

# Unless we force an overwrite.
rdir2 <- fetchDirectory("test/fetch/v2", registry=info$registry, url=info$url, cache=cache, forceRemote=TRUE, overwrite=TRUE)
expect_identical(readLines(file.path(rdir, "foo")), "BAR")
expect_identical(readLines(file.path(rdir2, "foo")), "BAR")

# Trying with multiple cores.
cache <- tempfile()
rdir2 <- fetchDirectory("test/fetch/v2", registry=info$registry, url=info$url, cache=cache, forceRemote=TRUE, concurrent=2)
expect_identical(readLines(file.path(rdir, "foo")), "BAR")
expect_identical(readLines(file.path(rdir2, "foo")), "BAR")
})

0 comments on commit b0f71ba

Please sign in to comment.