Skip to content

Commit

Permalink
Fixed test of timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
chriscarrollsmith committed Dec 10, 2024
1 parent 032ea79 commit 274b1b1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/testthat/test-ids_bulk.R
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,14 @@ test_that("ids_bulk handles timeout parameter correctly", {
local_mocked_bindings(
check_interactive = function() FALSE,
download_file = function(...) {
Sys.sleep(2)
stop("Operation timed out", call. = FALSE)
current_timeout <- getOption("timeout")
# Verify the timeout option was set correctly
if (current_timeout == 1) {
stop(paste0(
"Download timed out after ", current_timeout, " seconds"
), call. = FALSE)
}
stop("Unexpected timeout value", call. = FALSE)
},
get_response_headers = function(...) list("content-length" = "1000")
)
Expand Down

0 comments on commit 274b1b1

Please sign in to comment.