Skip to content

Commit

Permalink
test: break up read_sf_ext test + add read_sf_pkg test
Browse files Browse the repository at this point in the history
  • Loading branch information
elipousson committed Jun 13, 2023
1 parent 4966a8a commit a478c91
Showing 1 changed file with 6 additions and 37 deletions.
43 changes: 6 additions & 37 deletions tests/testthat/test-read_sf_ext.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
test_that("read_sf_ext works", {
skip_on_ci()
expect_s3_class(
read_sf_ext(
url = "https://sampleserver6.arcgisonline.com/arcgis/rest/services/NapervilleShelters/FeatureServer/0"
),
"sf"
)
test_that("read_sf_ext works with file paths", {

nc <- read_sf_ext(
path = system.file("shape/nc.shp", package = "sf")
Expand Down Expand Up @@ -38,39 +31,15 @@ test_that("read_sf_ext works", {
),
"sf"
)
})

test_that("read_sf_ext works with mapbaltimore package", {
skip_if_not_installed("mapbaltimore")
expect_s3_class(
read_sf_ext(
url = "https://gist.githubusercontent.com/elipousson/77271144b3cb82efd732c4e30b273c5a/raw/68dc6008fe27cb7047aa1c5dfba1fa17f6f88f16/baltimore_city_tracts_acs5_2019_B02001_003.geojson"
),
"sf"
)

expect_s3_class(
read_sf_ext(
url = "https://www.google.com/maps/d/u/0/viewer?mid=1CEssu_neU7lx_vAZs5qpufOBoUQ&ll=-3.81666561775622e-14%2C0&z=1"
),
"sf"
)

# 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")
"trees",
package = "mapbaltimore"
),
"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"
)
})

0 comments on commit a478c91

Please sign in to comment.