X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/78de557466248e1a193e07ae1945b29a23fc56a8..8afc85aabb9563da4de17b0b5f7d4fe574e9ad8d:/sdk/R/tests/testthat/test-ArvadosFile.R diff --git a/sdk/R/tests/testthat/test-ArvadosFile.R b/sdk/R/tests/testthat/test-ArvadosFile.R index 43c841bf8c..fb14888aab 100644 --- a/sdk/R/tests/testthat/test-ArvadosFile.R +++ b/sdk/R/tests/testthat/test-ArvadosFile.R @@ -1,7 +1,16 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + source("fakes/FakeRESTService.R") context("ArvadosFile") +test_that("constructor raises error if file name is empty string", { + + expect_that(ArvadosFile$new(""), throws_error("Invalid name.")) +}) + test_that("getFileListing always returns file name", { dog <- ArvadosFile$new("dog") @@ -207,6 +216,7 @@ test_that(paste("move raises exception if newLocationInCollection", "animal/dog", "animal/fish/shark", "ball") + fakeREST <- FakeRESTService$new(collectionContent) api <- Arvados$new("myToken", "myHostName") @@ -227,6 +237,7 @@ test_that("move raises exception if new location contains content with the same "animal/dog", "animal/fish/shark", "dog") + fakeREST <- FakeRESTService$new(collectionContent) api <- Arvados$new("myToken", "myHostName") @@ -247,6 +258,7 @@ test_that("move moves arvados file inside collection tree", { "animal/dog", "animal/fish/shark", "ball") + fakeREST <- FakeRESTService$new(collectionContent) api <- Arvados$new("myToken", "myHostName") @@ -260,4 +272,4 @@ test_that("move moves arvados file inside collection tree", { expect_that(dogIsNullOnOldLocation, is_true()) expect_that(dogExistsOnNewLocation, is_true()) -}) +})