Skip to content

Commit

Permalink
Switch to better http service for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
juliasilge committed Mar 2, 2023
1 parent 57c4206 commit 36e86d5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions tests/testthat/_snaps/pin.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# unavailable url can use cache

Code
pin("http://httpstat.us/404", "test", board = board)
pin("http://httpbin.org/status/404", "test", board = board)
Condition
Error in `pin()`:
! Client error: (404) Not Found. Failed to download remote file: http://httpstat.us/404
! Client error: (404) Not Found. Failed to download remote file: http://httpbin.org/status/404
Code
pin(1:10, "test", board = board)
x <- pin("http://httpstat.us/404", "test", board = board)
x <- pin("http://httpbin.org/status/404", "test", board = board)
Condition
Warning:
Failed to re-download pin; using cached value
* Client error: (404) Not Found. Failed to download remote file: http://httpstat.us/404
* Client error: (404) Not Found. Failed to download remote file: http://httpbin.org/status/404
Code
expect_equal(x, 1:10)

Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-pin.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ test_that("unavailable url can use cache", {
board <- legacy_temp()

expect_snapshot(error = TRUE, {
pin("http://httpstat.us/404", "test", board = board)
pin("http://httpbin.org/status/404", "test", board = board)
pin(1:10, "test", board = board)
x <- pin("http://httpstat.us/404", "test", board = board)
x <- pin("http://httpbin.org/status/404", "test", board = board)
expect_equal(x, 1:10)
})
})
Expand Down

0 comments on commit 36e86d5

Please sign in to comment.