tests/testthat/test-get_json.R

## Get time json for first week of October 2020
x <- get_json_time(from = as.Date("2020-10-01"), to = as.Date("2020-10-07"))

test_that("json url is correct", {
  expect_true(stringr::str_detect(x, pattern = "2020-10-01"))
  expect_true(stringr::str_detect(x, pattern = "2020-10-07"))
})


## Get actions json
x <- get_json_actions(ccode = "PHL",
                      from = as.Date("2020-10-01"),
                      to = as.Date("2020-10-07"))

test_that("json url is correct", {
  expect_true(length(x) == 7)
})

Try the oxcgrt package in your browser

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

oxcgrt documentation built on Nov. 27, 2020, 5:07 p.m.