tests/testthat/test_reflect_defaults.R

test_that("Default values are correctly reflected from filesystem + options", {
  skip("Can't map to IHME filesystem using Github CI. Revisit.")
  old.options <- options(
    # path is relative to the directory this test file is in
    "ihme.covid.roots.model-inputs" = "fixtures/model-inputs",
    "ihme.covid.versions.model-inputs" = "2020_05_25.02"
  )
  # re-set values at end of this function
  on.exit(options(old.options), add = TRUE)
  
  reflect_defaults()

  expect_equal(getOption("ihme.covid.locations.covariate"), list(location_set_id = 111, location_set_version_id = 680))
  expect_equal(getOption("ihme.covid.locations.modeling"), list(location_set_id = 111, location_set_version_id = 674))
})
ihmeuw/ihme.covid documentation built on Nov. 2, 2022, 2:25 a.m.