Skip to content

Commit

Permalink
test: expand st_make_grid_ext tests + restore read_sf_ext tests
Browse files Browse the repository at this point in the history
elipousson committed Apr 29, 2023
1 parent 9e97b5b commit abe316a
Showing 2 changed files with 29 additions and 19 deletions.
38 changes: 19 additions & 19 deletions tests/testthat/test-read_sf_ext.R
Original file line number Diff line number Diff line change
@@ -36,23 +36,23 @@ test_that("read_sf_ext works", {
)

# skip_if_offline("opendata.baltimorecity.gov/egis/rest/services/")
# expect_s3_class(
# read_sf_ext(
# url = "https://opendata.baltimorecity.gov/egis/rest/services/Hosted/311_Customer_Service_Requests_2020_csv/FeatureServer/0",
# name = "Abell",
# name_col = "neighborhood",
# coords = c("longitude", "latitude")
# ),
# "sf"
# )
#
# expect_s3_class(
# read_sf_ext(
# url = "https://opendata.baltimorecity.gov/egis/rest/services/Hosted/311_Customer_Service_Requests_2020_csv/FeatureServer/0",
# name = "Abell",
# name_col = "neighborhood",
# coords = NULL
# ),
# "data.frame"
# )
expect_s3_class(
read_sf_ext(
url = "https://opendata.baltimorecity.gov/egis/rest/services/Hosted/311_Customer_Service_Requests_2020_csv/FeatureServer/0",
name = "Abell",
name_col = "neighborhood",
coords = c("longitude", "latitude")
),
"sf"
)

expect_s3_class(
read_sf_ext(
url = "https://opendata.baltimorecity.gov/egis/rest/services/Hosted/311_Customer_Service_Requests_2020_csv/FeatureServer/0",
name = "Abell",
name_col = "neighborhood",
coords = NULL
),
"data.frame"
)
})
10 changes: 10 additions & 0 deletions tests/testthat/test-st_make_grid_ext.R
Original file line number Diff line number Diff line change
@@ -5,6 +5,11 @@ test_that("st_make_grid_ext works", {
"sf"
)

expect_s3_class(
st_make_grid_ext(as_bbox(nc)),
"sf"
)

expect_s3_class(
st_make_grid_ext(nc, ncol = 4, nrow = 1),
"sf"
@@ -19,4 +24,9 @@ test_that("st_make_grid_ext works", {
st_make_grid_ext(nc, n = 10, style = "square"),
"sf"
)

expect_s3_class(
st_make_grid_ext(nc, n = 10, style = "circle"),
"sf"
)
})

0 comments on commit abe316a

Please sign in to comment.