tests/testthat/test-read_dictionary.R

test_that("read_dictionary works", {
  testing_object <-
    read_dictionary(
      city = "São Paulo",
      year = 1997,
      harmonize = FALSE
    )

  expect_equal(is.data.frame(testing_object), TRUE)

  # Testing error message
  expect_snapshot(
    read_dictionary(
      city = "Manaus",
      year = 1977,
      harmonize = FALSE
    ),
    error = TRUE
  )
  expect_snapshot(
    read_dictionary(
      city = "São Paulo",
      year = 1978,
      harmonize = FALSE
    ),
    error = TRUE
  )
  expect_snapshot(
    read_dictionary(
      city = "São Paulo",
      year = 1977,
      harmonize = TRUE
    ),
    error = TRUE
  )
})

Try the odbr package in your browser

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

odbr documentation built on Nov. 21, 2023, 1:07 a.m.