tests/testthat/test-stations_ogimet.R

test_that("stations_ogimet", {
  x = suppressWarnings(stations_ogimet(country = "Australia", add_map = TRUE))

  testthat::expect_true(nrow(x) >= 100)
  testthat::expect_equal(ncol(x), 5)

  if (requireNamespace("maps", quietly = TRUE)) {
  x = suppressWarnings(stations_ogimet(country = "Australia", add_map = TRUE))
  }

  expect_error(stations_ogimet(country = NULL, add_map = FALSE))
  expect_error(stations_ogimet(date = NULL, add_map = FALSE))
})

Try the climate package in your browser

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

climate documentation built on Aug. 9, 2022, 5:08 p.m.