tests/testthat/test-get_data.R

x <- get_data(tbl_name = "epidemiology",
              .source = "WRD_ECDC",
              ccode = "GBR",
              adm = 0)

test_that("get_data output is tbl", {
  expect_is(x, "tbl")
})

test_that("get_data retrieves correct country data", {
  expect_equal(unique(x$countrycode), "GBR")
})

x <- get_data_epidemiology(.source = "WRD_ECDC",
                           ccode = "UK",
                           adm = 0)

test_that("get_data output is tbl", {
  expect_is(x, "tbl")
})

test_that("get_data retrieves correct country data", {
  expect_equal(unique(x$countrycode), "GBR")
})


x <- get_data_weather(ccode = "Spain", adm = 1)

test_that("get_data output is tbl", {
  expect_is(x, "tbl")
})

test_that("get_data retrieves correct country data", {
  expect_equal(unique(x$countrycode), "ESP")
})


x <- get_data_mobility(.source = "APPLE_MOBILITY", ccode = "FR", adm = 0)

test_that("get_data output is tbl", {
  expect_is(x, "tbl")
})

test_that("get_data retrieves correct country data", {
  expect_equal(unique(x$countrycode), "FRA")
})


x <- get_data_response(ccode = "Philippines", adm = 0)

test_that("get_data output is tbl", {
  expect_is(x, "tbl")
})

test_that("get_data retrieves correct country data", {
  expect_equal(unique(x$countrycode), "PHL")
})

Try the oxcovid19 package in your browser

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

oxcovid19 documentation built on Jan. 13, 2021, 8:50 p.m.