Skip to content

Commit

Permalink
Remove now-failing tests for maintianing prov statements
Browse files Browse the repository at this point in the history
  • Loading branch information
amoeba committed Dec 2, 2017
1 parent 2678bec commit fb5d654
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 48 deletions.
38 changes: 0 additions & 38 deletions tests/testthat/test_editing.R
Original file line number Diff line number Diff line change
Expand Up @@ -176,44 +176,6 @@ test_that("we can publish an update to an object and specify our own format id",
expect_equal(sm@formatId, "text/plain")
})

test_that("extra statements are maintained between updates", {
if (!is_token_set(mn)) {
skip("No token set. Skipping test.")
}

pkg <- create_dummy_package(mn, 3)

# Add some PROV triples to the Resource Map
rm <- tempfile()
writeLines(rawToChar(dataone::getObject(mn, pkg$resource_map)), rm)

statements <- data.frame(subject = paste0("https://cn.dataone.org/cn/v2/resolve/", URLencode(pkg$data[1], reserved = TRUE)),
predicate = "http://www.w3.org/ns/prov#wasDerivedFrom",
object = paste0("https://cn.dataone.org/cn/v2/resolve/", URLencode(pkg$data[2], reserved = TRUE)),
subjectType = "uri",
objectType = "uri",
dataTypeURI = NA)

new_rm <- update_resource_map(mn,
pkg$resource_map,
pkg$metadata,
pkg$data,
other_statements = statements,
public = TRUE)

rm <- tempfile()
writeLines(rawToChar(dataone::getObject(mn, new_rm)), rm)
statements <- parse_resource_map(rm)
expect_true("http://www.w3.org/ns/prov#wasDerivedFrom" %in% statements$predicate)

new_new_rm <- update_resource_map(mn, new_rm, pkg$metadata, pkg$data, public = TRUE)
rm <- tempfile()
writeLines(rawToChar(dataone::getObject(mn, new_new_rm)), rm)
statements <- parse_resource_map(rm)
expect_true("http://www.w3.org/ns/prov#wasDerivedFrom" %in% statements$predicate)
})


test_that("rightsholder is properly set back after publishing an update", {
if (!is_token_set(mn)) {
skip("No token set. Skipping test.")
Expand Down
10 changes: 0 additions & 10 deletions tests/testthat/test_packaging.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,3 @@ test_that("child pids are correctly determined", {
expect_equal(determine_child_pids(inventory, "B"), "resource_map_C")
expect_equal(determine_child_pids(inventory, "C"), NULL)
})


test_that("extra triple can be added to a resource map", {
path <- generate_resource_map("metadata", "data",
other_statements = data.frame(subject="http://example.com/me",
predicate="http://example.com/is_related_to",
object="http://example.com/myself"))
statements <- parse_resource_map(path)
expect_true("http://example.com/me" %in% statements$subject)
})

0 comments on commit fb5d654

Please sign in to comment.