Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dieghernan committed Aug 15, 2023
1 parent 9e7bdfe commit 10c01f8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
30 changes: 16 additions & 14 deletions tests/testthat/test-geo_amenity_sf.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ test_that("Returning not reachable", {
skip_on_cran()
skip_if_api_server()

expect_message(obj <- geo_amenity_sf(
bbox = c(-1.1446, 41.5022, -0.4854, 41.8795),
amenity = "xbzbzbzoa aiaia"
))
expect_message(
obj <- geo_amenity_sf(
bbox = c(-1.1446, 41.5022, -0.4854, 41.8795),
amenity = "xbzbzbzoa aiaia"
)
)

expect_true(nrow(obj) == 1)
expect_true(obj$query == "xbzbzbzoa aiaia")
Expand Down Expand Up @@ -62,17 +64,17 @@ test_that("Data format", {

# Polygon

expect_message(hosp <- geo_amenity_sf(
c(
-3.888954, 40.311977,
-3.517916, 40.643729
),
c("hospital", "dump", "pub"),
points_only = FALSE
), "No results for query dump")

expect_message(
hosp <- geo_amenity_sf(
c(
-3.888954, 40.311977,
-3.517916, 40.643729
),
c("hospital", "dump", "pub"),
points_only = FALSE
), "No results for query dump"
)

expect_true(any("POLYGON" == sf::st_geometry_type(hosp)))
expect_s3_class(hosp, "sf")
expect_s3_class(hosp, "tbl")
expect_equal(nrow(hosp), 3)
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-geo_lite.R
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ test_that("Checking query", {


expect_gt(
nrow(geo_lite("Madrid",
nrow(geo_lite("Burger King",
limit = 10,
custom_query = list(countrycode = "es")
custom_query = list(countrycode = "ES")
)), 4
)

Expand Down

0 comments on commit 10c01f8

Please sign in to comment.