tests/testthat/test-fc_parsers.R

context("parsers")

testthat::skip_on_cran()
testthat::skip_if(Sys.getenv("FC_PRIVATE_KEY") == "")
testthat::skip_if(!fc_ping())

stations <- fc_get_user_stations()
data <- fc_get_data_range(
  station_id = stations[[1]]$station_name,
  data_group = "raw",
  from = as.integer(as.POSIXct(Sys.time() - 60 * 60 * 24)),
  to =  as.integer(as.POSIXct(Sys.time())))
parsed_data <- fc_parse_data(data)
parsed_stations <- fc_parse_stations(stations)

test_that("fc_parse_data() works", {
  expect_is(parsed_data, "data.frame")
})

test_that("fc_parse_stations() works", {
  expect_is(parsed_stations, "data.frame")
})

Try the rfieldclimate package in your browser

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

rfieldclimate documentation built on March 31, 2023, 5:33 p.m.