tests/testthat/test-tar_resources_url.R

tar_test("tar_resources_url()", {
  out <- tar_resources_url()
  expect_silent(resources_validate(out))
})

tar_test("tar_resources_url() default handle", {
  skip_if_not_installed("curl")
  tar_option_set(
    resources = tar_resources(
      url = tar_resources_url(
        handle = curl::new_handle(),
        seconds_interval = 2,
        seconds_timeout = 3
      )
    )
  )
  out <- tar_option_get("resources")$url
  expect_true(inherits(out$handle, "curl_handle"))
  expect_equal(out$seconds_interval, 2)
  expect_equal(out$seconds_timeout, 3)
})

Try the targets package in your browser

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

targets documentation built on Oct. 12, 2023, 5:07 p.m.