-
Notifications
You must be signed in to change notification settings - Fork 25
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
Showing
9 changed files
with
65 additions
and
29 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 |
---|---|---|
@@ -1,2 +1,8 @@ | ||
library("testthat") | ||
#test_check("dataverse") | ||
local({ | ||
library("dataverse") | ||
dv_server <- Sys.getenv("DATAVERSE_SERVER") | ||
on.exit(Sys.setenv("DATAVERSE_SERVER" = dv_server)) | ||
Sys.setenv("DATAVERSE_SERVER" = "dataverse.harvard.edu") | ||
#test_check("dataverse") | ||
}) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
context("Data Access API") | ||
|
||
test_that("get file metadata from DOI and filename", { | ||
f1 <- get_metadata("constructionData.tab", "doi:10.7910/DVN/ARKOTI", server = "dataverse.harvard.edu") | ||
expect_true(is.list(f1)) | ||
}) | ||
|
||
test_that("get file metadata from file id", { | ||
f1 <- get_metadata(2692202, server = "dataverse.harvard.edu") | ||
expect_true(is.list(f1)) | ||
}) | ||
|
||
test_that("download file from DOI and filename", { | ||
f1 <- get_file("constructionData.tab", "doi:10.7910/DVN/ARKOTI", server = "dataverse.harvard.edu") | ||
expect_true(is.raw(f1)) | ||
}) | ||
|
||
test_that("download file from file id", { | ||
f2 <- get_file(2692202, server = "dataverse.harvard.edu") | ||
expect_true(is.raw(f2)) | ||
}) |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
if (Sys.getenv("DATAVERSE_KEY") != "") { | ||
context("Native API (authenticated functions)") | ||
|
||
test_that("placeholder", { | ||
expect_true(TRUE) | ||
}) | ||
} | ||
|
||
context("Native API (unauthenticated functions)") | ||
|
||
test_that("placeholder", { | ||
expect_true(TRUE) | ||
}) |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
context("Search API") | ||
|
||
if (Sys.getenv("DATAVERSE_KEY") != "") { | ||
|
||
test_that("simple search query", { | ||
expect_true(is.data.frame(dataverse_search("Gary King"))) | ||
}) | ||
|
||
test_that("named argument search", { | ||
expect_true(is.data.frame(dataverse_search(author = "Gary King", title = "Ecological Inference"))) | ||
}) | ||
|
||
test_that("simple search w/type argument", { | ||
expect_true(is.data.frame(dataverse_search(author = "Gary King", type = "dataset"))) | ||
}) | ||
|
||
} |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
context("SWORD API") | ||
|
||
if (Sys.getenv("DATAVERSE_KEY") != "") { | ||
test_that("placeholder", { | ||
expect_true(TRUE) | ||
}) | ||
} |