tests/testthat/test-sounding_wyoming.R

context("meteo_imgw")

test_that("sounding_wyoming works!", {
  profile <- sounding_wyoming(wmo_id = 12120,
                              yy = 2019,
                              mm = 4,
                              dd = 4,
                              hh = 0)

  # expected error
  testthat::expect_message(sounding_wyoming(wmo_id = 12220,
                                            yy = 2019,
                                            mm = 4,
                                            dd = 4,
                                            hh = 0))

  # expected error
  testthat::expect_error(sounding_wyoming(wmo_id = c(12220, 12375),
                                          yy = 2019,
                                          mm = 4,
                                          dd = 4,
                                          hh = 0))
  
  # expected error for bufr
  testthat::expect_error(sounding_wyoming(wmo_id = 12375,
                                          yy = 2019,
                                          mm = 4,
                                          dd = 4,
                                          hh = 0,
                                          bufr = TRUE))
})

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.