sgat.Rcheck/00_pkg_src/sgat/tests/testthat/test-sgat.R

skip_on_cran()
skip_if_offline(host = "r-project.org")

try(initialization_sgat(), silent = TRUE)

test_that("gives correct data frame if information is found", {
  coutume <- sgat("coutume, 47 rue de babylone, 75007 paris, france", tiempo.espera = 20)
  expect_s3_class(coutume, "data.frame")
  expect_identical(unique(coutume$lugar), "coutume, 47 rue de babylone, 75007 paris, france")
  expect_lt(max(coutume$hora), 24)
  expect_gt(min(coutume$hora), 0)
  expect_type(coutume$latitud, "double")
  expect_type(coutume$longitud, "double")
})

test_that("gives NULL if information is not found", {
  expect_null(moustacchio <- sgat("Moustacchio, San Martín 298, Ushuaia, Argentina"))
})

test_that("error if no lugar.a.buscar and or dia.seman typed", {
  expect_error(sgat())
})
matiaspoullain/sgat documentation built on Aug. 13, 2022, 4:21 a.m.