Skip to content

Commit

Permalink
Rename mn variable to node variable
Browse files Browse the repository at this point in the history
  • Loading branch information
amoeba committed Nov 9, 2016
1 parent 6f8b238 commit 2463620
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions tests/testthat/test_dataone.R
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
context("dataone")

mn <- env_load()$mn
node <- env_load()$node

test_that("permissions can be checked", {
if (!is_token_set(mn)) {
if (!is_token_set(node)) {
skip("No token set. Skipping test.")
}

id <- create_dummy_object(mn)
expect_true(is_authorized(mn, id, "write"))
id <- create_dummy_object(node)
expect_true(is_authorized(node, id, "write"))
})

test_that("permissions can be checked on multiple objects", {
if (!is_token_set(mn)) {
if (!is_token_set(node)) {
skip("No token set. Skipping test.")
}

a <- create_dummy_object(mn)
b <- create_dummy_object(mn)
a <- create_dummy_object(node)
b <- create_dummy_object(node)

expect_true(all(is_authorized(mn, c(a, b), "write")))
expect_true(all(is_authorized(node, c(a, b), "write")))
})

test_that("checking permissions on a missing object returns an error", {
if (!is_token_set(mn)) {
if (!is_token_set(node)) {
skip("No token set. Skipping test.")
}

# Create a pid likely to not exist
id <- paste0(uuid::UUIDgenerate(), uuid::UUIDgenerate())

expect_error(is_authorized(mn, id, "write"))
expect_error(is_authorized(node, id, "write"))
})

0 comments on commit 2463620

Please sign in to comment.