tests/testthat/test-save.R

test_that("`ps_save()` works", {
  url <- 'https://planscore.s3.amazonaws.com/uploads/20221127T213653.168557156Z/index.json'
  tf <- tempfile(fileext = '.json')

  out <- NULL
  try({ # relies on internet resource
    out <- ps_save(url, tf)
  })

  testthat::skip_if(is.null(out), "ps_save() internet resource failed.")
  expect_true(file.exists(tf))
})

Try the planscorer package in your browser

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

planscorer documentation built on Sept. 24, 2024, 5:08 p.m.