From fb5d654715ff58651bed8b574b4b1826d9da12f3 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Fri, 1 Dec 2017 15:48:05 -0900 Subject: [PATCH] Remove now-failing tests for maintianing prov statements --- tests/testthat/test_editing.R | 38 --------------------------------- tests/testthat/test_packaging.R | 10 --------- 2 files changed, 48 deletions(-) diff --git a/tests/testthat/test_editing.R b/tests/testthat/test_editing.R index 0d607c3..c0b9e7f 100644 --- a/tests/testthat/test_editing.R +++ b/tests/testthat/test_editing.R @@ -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.") diff --git a/tests/testthat/test_packaging.R b/tests/testthat/test_packaging.R index 94a9ef3..6bb9891 100644 --- a/tests/testthat/test_packaging.R +++ b/tests/testthat/test_packaging.R @@ -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) -})