tests/testthat/test-utils.R

test_that("check if retry is working correctly", {
  logger = lgr::get_logger("s3fs")

  err_fun = function() stop(
    structure(list(message = "error"), class = c("http_500", "error", "condition"))
  )
  expect_error(
    retry_api_call(
      err_fun(),
      2
    )
  )
  expect_true(grepl("0.4", logger$last_event$msg))
})

Try the s3fs package in your browser

Any scripts or data that you put into this service are public.

s3fs documentation built on Sept. 11, 2024, 6:48 p.m.