forked from ropensci/ckanr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* See ropensci#215: support multiple CKAN versions * Disable tests for deprecated API endpoints as of CKAN 2.10 * Introduce a default for get_test_url and get_test_behaviour * Format ckanr_settings
- Loading branch information
Showing
8 changed files
with
170 additions
and
131 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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,33 +1,33 @@ | ||
context("changes") | ||
|
||
skip_on_cran() | ||
|
||
u <- get_test_url() | ||
check_ckan(u) | ||
|
||
test_that("changes gives back expected class types", { | ||
cat(u, sep = "\n") | ||
a <- changes(url = u) | ||
|
||
expect_is(a, "list") | ||
expect_is(a[[1]], "list") | ||
expect_is(a[[1]]$user_id, "character") | ||
expect_is(a[[1]]$data, "list") | ||
}) | ||
|
||
test_that("changes works giving back json output", { | ||
b <- changes(url = u, as = 'json') | ||
b_df <- jsonlite::fromJSON(b) | ||
|
||
expect_is(b, "character") | ||
expect_is(b_df, "list") | ||
expect_is(b_df$result, "data.frame") | ||
}) | ||
|
||
test_that("changes fails correctly", { | ||
|
||
expect_error(changes("adf"), "offset Invalid integer") | ||
expect_error(changes(limit = "Adf"), "limit Invalid integer") | ||
expect_error(changes("adf", url = "http://www.google.com"), | ||
regexp = "404") | ||
}) | ||
# context("changes") | ||
# | ||
# skip_on_cran() | ||
# | ||
# u <- get_test_url() | ||
# check_ckan(u) | ||
# | ||
# test_that("changes gives back expected class types", { | ||
# cat(u, sep = "\n") | ||
# a <- changes(url = u) | ||
# | ||
# expect_is(a, "list") | ||
# expect_is(a[[1]], "list") | ||
# expect_is(a[[1]]$user_id, "character") | ||
# expect_is(a[[1]]$data, "list") | ||
# }) | ||
# | ||
# test_that("changes works giving back json output", { | ||
# b <- changes(url = u, as = 'json') | ||
# b_df <- jsonlite::fromJSON(b) | ||
# | ||
# expect_is(b, "character") | ||
# expect_is(b_df, "list") | ||
# expect_is(b_df$result, "data.frame") | ||
# }) | ||
# | ||
# test_that("changes fails correctly", { | ||
# | ||
# expect_error(changes("adf"), "offset Invalid integer") | ||
# expect_error(changes(limit = "Adf"), "limit Invalid integer") | ||
# expect_error(changes("adf", url = "http://www.google.com"), | ||
# regexp = "404") | ||
# }) |
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
Oops, something went wrong.