tests/testthat/test-airport_finder.R

context("airport finder")

test_that("correct output", {
  # load station data
  finder_typo <- airport_finder(name = "Exter", country = "United Kingdom")
  finder_port <- airport_finder(IATA_code = "LHS")
  
  expect_equal(finder_typo$City, "Exeter")
  expect_equal(finder_typo$IATA, "EXT")
  expect_equal(finder_port$Name, "Las Heras Airport")
  expect_equal(length(airport_finder(city = "Nairobi")), 4)
})

Try the carbonr package in your browser

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

carbonr documentation built on Oct. 17, 2024, 1:06 a.m.