From 8bb7972f4a1a98ff63973a19f19efe3a2ef8b44d Mon Sep 17 00:00:00 2001 From: Diego H Date: Thu, 21 Oct 2021 08:47:14 +0200 Subject: [PATCH] Update skips on tests --- tests/testthat/test-geo_address_lookup.R | 8 +++++--- tests/testthat/test-geo_address_lookup_sf.R | 9 ++++++--- tests/testthat/test-geo_amenity.R | 8 +++++--- tests/testthat/test-geo_amenity_sf.R | 8 +++++--- tests/testthat/test-geo_lite.R | 8 +++++--- tests/testthat/test-geo_lite_sf.R | 11 +++++++---- tests/testthat/test-reverse_geo_lite.R | 11 +++++++---- tests/testthat/test-reverse_geo_lite_sf.R | 11 +++++++---- 8 files changed, 47 insertions(+), 27 deletions(-) diff --git a/tests/testthat/test-geo_address_lookup.R b/tests/testthat/test-geo_address_lookup.R index 6fecbc4b..898dde22 100644 --- a/tests/testthat/test-geo_address_lookup.R +++ b/tests/testthat/test-geo_address_lookup.R @@ -1,8 +1,8 @@ test_that("Returning empty query", { expect_message(geo_address_lookup("xbzbzbzoa aiaia", "R")) - skip_if_api_server() skip_on_cran() + skip_if_api_server() obj <- geo_address_lookup("xbzbzbzoa aiaia", "R") @@ -12,9 +12,10 @@ test_that("Returning empty query", { }) test_that("Data format", { + skip_on_cran() skip_if_api_server() skip_if_offline() - skip_on_cran() + expect_true(is.data.frame(geo_address_lookup(34633854, "W"))) expect_false(inherits(geo_address_lookup(34633854, "W"), "sf")) @@ -22,9 +23,10 @@ test_that("Data format", { }) test_that("Checking query", { + skip_on_cran() skip_if_api_server() skip_if_offline() - skip_on_cran() + expect_equal(ncol(geo_address_lookup(34633854, "W")), 4) expect_gt(ncol(geo_address_lookup(34633854, "W", full_results = TRUE)), 4) diff --git a/tests/testthat/test-geo_address_lookup_sf.R b/tests/testthat/test-geo_address_lookup_sf.R index 72332406..7ba3e643 100644 --- a/tests/testthat/test-geo_address_lookup_sf.R +++ b/tests/testthat/test-geo_address_lookup_sf.R @@ -1,7 +1,9 @@ test_that("Returning empty query", { expect_message(geo_address_lookup_sf("xbzbzbzoa aiaia", "R")) - skip_if_api_server() + skip_on_cran() + skip_if_api_server() + obj <- geo_address_lookup_sf("xbzbzbzoa aiaia", "R") @@ -11,18 +13,19 @@ test_that("Returning empty query", { }) test_that("Data format", { + skip_on_cran() skip_if_api_server() skip_if_offline() - skip_on_cran() expect_true(is.data.frame(geo_address_lookup_sf(34633854, "W"))) expect_s3_class(geo_address_lookup_sf(34633854, "W"), "sf") }) test_that("Checking query", { + skip_on_cran() skip_if_api_server() skip_if_offline() - skip_on_cran() + expect_equal(ncol(geo_address_lookup_sf(34633854, "W")), 3) expect_gt(ncol(geo_address_lookup_sf(34633854, "W", full_results = TRUE)), 3) diff --git a/tests/testthat/test-geo_amenity.R b/tests/testthat/test-geo_amenity.R index 50b5f53c..96b3a4f4 100644 --- a/tests/testthat/test-geo_amenity.R +++ b/tests/testthat/test-geo_amenity.R @@ -4,8 +4,8 @@ test_that("Returning empty query", { amenity = "xbzbzbzoa aiaia" )) - skip_if_api_server() skip_on_cran() + skip_if_api_server() obj <- geo_amenity_sf( bbox = c(-1.1446, 41.5022, -0.4854, 41.8795), @@ -18,9 +18,10 @@ test_that("Returning empty query", { }) test_that("Data format", { + skip_on_cran() skip_if_api_server() skip_if_offline() - skip_on_cran() + expect_true(is.data.frame(geo_amenity( bbox = c(-1.1446, 41.5022, -0.4854, 41.8795), @@ -33,9 +34,10 @@ test_that("Data format", { }) test_that("Checking query", { + skip_on_cran() skip_if_api_server() skip_if_offline() - skip_on_cran() + expect_equal(ncol(geo_amenity( bbox = c(-1.1446, 41.5022, -0.4854, 41.8795), diff --git a/tests/testthat/test-geo_amenity_sf.R b/tests/testthat/test-geo_amenity_sf.R index 3cc817bc..ef5b5577 100644 --- a/tests/testthat/test-geo_amenity_sf.R +++ b/tests/testthat/test-geo_amenity_sf.R @@ -4,8 +4,8 @@ test_that("Returning empty query", { amenity = "xbzbzbzoa aiaia" )) - skip_if_api_server() skip_on_cran() + skip_if_api_server() obj <- geo_amenity_sf( bbox = c(-1.1446, 41.5022, -0.4854, 41.8795), @@ -17,9 +17,10 @@ test_that("Returning empty query", { }) test_that("Data format", { + skip_on_cran() skip_if_api_server() skip_if_offline() - skip_on_cran() + expect_true(is.data.frame(geo_amenity_sf( bbox = c(-1.1446, 41.5022, -0.4854, 41.8795), @@ -33,9 +34,10 @@ test_that("Data format", { test_that("Checking query", { + skip_on_cran() skip_if_api_server() skip_if_offline() - skip_on_cran() + expect_equal(ncol(geo_amenity_sf( bbox = c(-1.1446, 41.5022, -0.4854, 41.8795), diff --git a/tests/testthat/test-geo_lite.R b/tests/testthat/test-geo_lite.R index eb07af40..9bf147eb 100644 --- a/tests/testthat/test-geo_lite.R +++ b/tests/testthat/test-geo_lite.R @@ -1,8 +1,8 @@ test_that("Returning empty query", { expect_message(geo_lite("xbzbzbzoa aiaia")) - skip_if_api_server() skip_on_cran() + skip_if_api_server() obj <- geo_lite("xbzbzbzoa aiaia") @@ -12,9 +12,10 @@ test_that("Returning empty query", { }) test_that("Data format", { + skip_on_cran() skip_if_api_server() skip_if_offline() - skip_on_cran() + expect_true(is.data.frame(geo_lite("Madrid"))) expect_false(inherits(geo_lite("Madrid"), "sf")) @@ -23,9 +24,10 @@ test_that("Data format", { test_that("Checking query", { + skip_on_cran() skip_if_api_server() skip_if_offline() - skip_on_cran() + expect_equal(ncol(geo_lite(c("Madrid", "Barcelona"))), 4) expect_gt(ncol(geo_lite("Madrid", full_results = TRUE)), 4) diff --git a/tests/testthat/test-geo_lite_sf.R b/tests/testthat/test-geo_lite_sf.R index ee469617..03a151bb 100644 --- a/tests/testthat/test-geo_lite_sf.R +++ b/tests/testthat/test-geo_lite_sf.R @@ -1,8 +1,8 @@ test_that("Returning empty query", { expect_message(geo_lite_sf("xbzbzbzoa aiaia")) - skip_if_api_server() skip_on_cran() + skip_if_api_server() obj <- geo_lite_sf("xbzbzbzoa aiaia") @@ -11,18 +11,20 @@ test_that("Returning empty query", { }) test_that("Data format", { + skip_on_cran() skip_if_api_server() skip_if_offline() - skip_on_cran() + expect_true(is.data.frame(geo_lite_sf("Madrid"))) expect_s3_class(geo_lite_sf("Madrid"), "sf") }) test_that("Checking query", { + skip_on_cran() skip_if_api_server() skip_if_offline() - skip_on_cran() + expect_equal(ncol(geo_lite_sf(c("Madrid", "Barcelona"))), 3) expect_gt(ncol(geo_lite_sf("Madrid", full_results = TRUE)), 3) @@ -40,9 +42,10 @@ test_that("Checking query", { }) test_that("Checking geometry type", { + skip_on_cran() skip_if_api_server() skip_if_offline() - skip_on_cran() + expect_true( sf::st_geometry_type(geo_lite_sf("Pentagon")) == "POINT" diff --git a/tests/testthat/test-reverse_geo_lite.R b/tests/testthat/test-reverse_geo_lite.R index 3799806a..ae9a4e5b 100644 --- a/tests/testthat/test-reverse_geo_lite.R +++ b/tests/testthat/test-reverse_geo_lite.R @@ -1,8 +1,8 @@ test_that("Returning empty query", { expect_message(reverse_geo_lite(200, 200)) - skip_if_api_server() skip_on_cran() + skip_if_api_server() obj <- reverse_geo_lite(200, 200) @@ -11,18 +11,20 @@ test_that("Returning empty query", { }) test_that("Returning error", { + skip_on_cran() skip_if_api_server() skip_if_offline() - skip_on_cran() + expect_error(reverse_geo_lite(0, c(2, 3))) expect_error(reverse_geo_lite("a", "a")) }) test_that("Data format", { + skip_on_cran() skip_if_api_server() skip_if_offline() - skip_on_cran() + expect_true(is.data.frame(reverse_geo_lite(0, 0))) expect_false(inherits(reverse_geo_lite(0, 0), "sf")) @@ -30,9 +32,10 @@ test_that("Data format", { }) test_that("Checking query", { + skip_on_cran() skip_if_api_server() skip_if_offline() - skip_on_cran() + expect_equal(ncol(reverse_geo_lite(0, 0)), 3) expect_gt(ncol(reverse_geo_lite(0, 0, full_results = TRUE)), 3) diff --git a/tests/testthat/test-reverse_geo_lite_sf.R b/tests/testthat/test-reverse_geo_lite_sf.R index 0c123180..b16602ee 100644 --- a/tests/testthat/test-reverse_geo_lite_sf.R +++ b/tests/testthat/test-reverse_geo_lite_sf.R @@ -1,8 +1,8 @@ test_that("Returning empty query", { expect_message(reverse_geo_lite_sf(200, 200)) - skip_if_api_server() skip_on_cran() + skip_if_api_server() obj <- reverse_geo_lite_sf(200, 200) @@ -11,27 +11,30 @@ test_that("Returning empty query", { }) test_that("Returning error", { + skip_on_cran() skip_if_api_server() skip_if_offline() - skip_on_cran() + expect_error(reverse_geo_lite_sf(0, c(2, 3))) expect_error(reverse_geo_lite_sf("a", "a")) }) test_that("Data format", { + skip_on_cran() skip_if_api_server() skip_if_offline() - skip_on_cran() + expect_true(is.data.frame(reverse_geo_lite_sf(0, 0))) expect_s3_class(reverse_geo_lite_sf(0, 0), "sf") }) test_that("Checking query", { + skip_on_cran() skip_if_api_server() skip_if_offline() - skip_on_cran() + expect_equal(ncol(reverse_geo_lite_sf(0, 0)), 4) expect_gt(ncol(reverse_geo_lite_sf(0, 0,