-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
df7b8fc
commit 0f9e242
Showing
14 changed files
with
39 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -111,7 +111,7 @@ references: | |
authors: | ||
- family-names: Ooms | ||
given-names: Jeroen | ||
email: [email protected] | ||
email: [email protected] | ||
orcid: https://orcid.org/0000-0002-4035-0289 | ||
year: '2024' | ||
identifiers: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,34 @@ | ||
test_that("Communes offline", { | ||
expect_error(gisco_get_communes(year = "2007")) | ||
expect_error(gisco_get_communes(epsg = "9999")) | ||
expect_error(gisco_get_communes(year = "2004", spatialtype = "COASTL")) | ||
expect_error(gisco_get_communes(year = "2004", spatialtype = "INLAND")) | ||
expect_error(gisco_get_communes(spatialtype = "ERR")) | ||
}) | ||
|
||
test_that("Communes online", { | ||
skip_on_cran() | ||
skip_if_gisco_offline() | ||
|
||
expect_silent(gisco_get_communes(spatialtype = "COASTL")) | ||
|
||
# Trying to query a dataset without a country field. Should show a message | ||
# even with verbose TRUE | ||
expect_message(gisco_get_communes( | ||
spatialtype = "COASTL", | ||
country = "LU", verbose = FALSE | ||
)) | ||
|
||
expect_message(gisco_get_communes(spatialtype = "LB", verbose = TRUE)) | ||
lu <- expect_silent(gisco_get_communes(spatialtype = "LB", country = "LU")) | ||
|
||
expect_equal(as.character(unique(lu$CNTR_CODE)), "LU") | ||
|
||
# Test selected years | ||
years <- c("2001", "2013") | ||
|
||
# Liechtenstein | ||
for (i in seq_len(length(years))) { | ||
lb <- gisco_get_communes( | ||
spatialtype = "LB", country = "LU", year = years[i], | ||
verbose = FALSE | ||
) | ||
|
||
expect_equal(as.character(unique(lb$CNTR_CODE)), "LU") | ||
} | ||
}) | ||
test_that("Communes offline", { | ||
expect_error(gisco_get_communes(year = "2007")) | ||
expect_error(gisco_get_communes(epsg = "9999")) | ||
expect_error(gisco_get_communes(year = "2004", spatialtype = "COASTL")) | ||
expect_error(gisco_get_communes(year = "2004", spatialtype = "INLAND")) | ||
expect_error(gisco_get_communes(spatialtype = "ERR")) | ||
}) | ||
|
||
test_that("Communes online", { | ||
skip_on_cran() | ||
skip_if_gisco_offline() | ||
|
||
expect_silent(gisco_get_communes(spatialtype = "COASTL")) | ||
|
||
# Trying to query a dataset without a country field. Should show a message | ||
# even with verbose TRUE | ||
expect_message(gisco_get_communes( | ||
spatialtype = "COASTL", | ||
country = "LU", verbose = FALSE | ||
)) | ||
|
||
expect_message(gisco_get_communes(spatialtype = "LB", verbose = TRUE)) | ||
lu <- expect_silent(gisco_get_communes(spatialtype = "LB", country = "LU")) | ||
|
||
expect_equal(as.character(unique(lu$CNTR_CODE)), "LU") | ||
|
||
# Test selected years | ||
lb <- gisco_get_communes( | ||
spatialtype = "LB", country = "LU", year = "2013", | ||
verbose = FALSE | ||
) | ||
|
||
expect_equal(as.character(unique(lb$CNTR_CODE)), "LU") | ||
}) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.