test_that(paste("add post content to a REST service",
"if subcollection belongs to a collection"), {
- api <- Arvados$new("myToken", "myHostName")
- api$setHttpClient(FakeHttpRequest$new())
- api$setHttpParser(FakeHttpParser$new())
-
collectionContent <- c("animal", "animal/fish")
fakeREST <- FakeRESTService$new(collectionContent)
+
+ api <- Arvados$new("myToken", "myHostName")
api$setRESTService(fakeREST)
collection <- Collection$new(api, "myUUID")
test_that(paste("remove removes content from REST service",
"if subcollection belongs to a collection"), {
- api <- Arvados$new("myToken", "myHostName")
- api$setHttpClient(FakeHttpRequest$new())
- api$setHttpParser(FakeHttpParser$new())
-
collectionContent <- c("animal", "animal/fish", "animal/dog")
-
fakeREST <- FakeRESTService$new(collectionContent)
+
+ api <- Arvados$new("myToken", "myHostName")
api$setRESTService(fakeREST)
collection <- Collection$new(api, "myUUID")
animal <- collection$get("animal")
test_that("move raises exception if new location contains content with the same name", {
- api <- Arvados$new("myToken", "myHostName")
- api$setHttpClient(FakeHttpRequest$new())
- api$setHttpParser(FakeHttpParser$new())
-
collectionContent <- c("animal",
"animal/fish",
"animal/dog",
"animal/fish/shark",
"fish")
-
fakeREST <- FakeRESTService$new(collectionContent)
+
+ api <- Arvados$new("myToken", "myHostName")
api$setRESTService(fakeREST)
collection <- Collection$new(api, "myUUID")
fish <- collection$get("animal/fish")
test_that(paste("move raises exception if newLocationInCollection",
"parameter is invalid"), {
- api <- Arvados$new("myToken", "myHostName")
- api$setHttpClient(FakeHttpRequest$new())
- api$setHttpParser(FakeHttpParser$new())
-
collectionContent <- c("animal",
"animal/fish",
"animal/dog",
"animal/fish/shark",
"ball")
-
fakeREST <- FakeRESTService$new(collectionContent)
+
+ api <- Arvados$new("myToken", "myHostName")
api$setRESTService(fakeREST)
collection <- Collection$new(api, "myUUID")
test_that("move moves subcollection inside collection tree", {
- api <- Arvados$new("myToken", "myHostName")
- api$setHttpClient(FakeHttpRequest$new())
- api$setHttpParser(FakeHttpParser$new())
-
collectionContent <- c("animal",
"animal/fish",
"animal/dog",
"animal/fish/shark",
"ball")
-
fakeREST <- FakeRESTService$new(collectionContent)
+
+ api <- Arvados$new("myToken", "myHostName")
api$setRESTService(fakeREST)
collection <- Collection$new(api, "myUUID")
fish <- collection$get("animal/fish")
test_that(paste("getSizeInBytes delegates size calculation",
"to REST service class"), {
- api <- Arvados$new("myToken", "myHostName")
- api$setHttpClient(FakeHttpRequest$new())
- api$setHttpParser(FakeHttpParser$new())
-
collectionContent <- c("animal", "animal/fish")
returnSize <- 100
-
fakeREST <- FakeRESTService$new(collectionContent, returnSize)
+
+ api <- Arvados$new("myToken", "myHostName")
api$setRESTService(fakeREST)
collection <- Collection$new(api, "myUUID")
animal <- collection$get("animal")