16827: Fix getFileNamesFromResponse
authorPeter Amstutz <peter.amstutz@curii.com>
Wed, 23 Sep 2020 20:17:09 +0000 (16:17 -0400)
committerPeter Amstutz <peter.amstutz@curii.com>
Thu, 24 Sep 2020 14:10:30 +0000 (10:10 -0400)
Update tests.

Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>

sdk/R/R/HttpParser.R
sdk/R/R/RESTService.R
sdk/R/R/autoGenAPI.R
sdk/R/tests/testthat/test-ArvadosFile.R
sdk/R/tests/testthat/test-Collection.R
sdk/R/tests/testthat/test-CollectionTree.R
sdk/R/tests/testthat/test-HttpParser.R
sdk/R/tests/testthat/test-HttpRequest.R
sdk/R/tests/testthat/test-RESTService.R
sdk/R/tests/testthat/test-Subcollection.R

index cd492166a139bf56dccebf732f2533c443440cf7..60bf7828278859e14fefaacebbcb5d762f1dbe99 100644 (file)
@@ -31,14 +31,13 @@ HttpParser <- R6::R6Class(
         {
             text <- rawToChar(response$content)
             doc <- XML::xmlParse(text, asText=TRUE)
-            base <- paste(paste("/", strsplit(uri, "/")[[1]][-1:-3], sep="", collapse=""), "/", sep="")
+            base <- paste("/", strsplit(uri, "/")[[1]][4], "/", sep="")
             result <- unlist(
                 XML::xpathApply(doc, "//D:response/D:href", function(node) {
                     sub(base, "", URLdecode(XML::xmlValue(node)), fixed=TRUE)
                 })
             )
-            result <- result[result != ""]
-            result[-1]
+            result[result != ""]
         },
 
         getFileSizesFromResponse = function(response, uri)
index 78b2c35e32fa117190f033075e1ea5ee2a3805e3..9c65e72861f41513936e431afda50f6ab443f983 100644 (file)
@@ -36,16 +36,13 @@ RESTService <- R6::R6Class(
         {
             if(is.null(private$webDavHostName))
             {
-                discoveryDocumentURL <- paste0("https://", private$rawHostName,
-                                               "/discovery/v1/apis/arvados/v1/rest")
+                publicConfigURL <- paste0("https://", private$rawHostName,
+                                               "/arvados/v1/config")
 
-                headers <- list(Authorization = paste("OAuth2", self$token))
-
-                serverResponse <- self$http$exec("GET", discoveryDocumentURL, headers,
-                                                 retryTimes = self$numRetries)
+                serverResponse <- self$http$exec("GET", publicConfigURL, retryTimes = self$numRetries)
 
-                discoveryDocument <- self$httpParser$parseJSONResponse(serverResponse)
-                private$webDavHostName <- discoveryDocument$keepWebServiceUrl
+                configDocument <- self$httpParser$parseJSONResponse(serverResponse)
+                private$webDavHostName <- configDocument$Services$WebDAVDownload$ExternalURL
 
                 if(is.null(private$webDavHostName))
                     stop("Unable to find WebDAV server.")
@@ -118,7 +115,7 @@ RESTService <- R6::R6Class(
             collectionURL <- URLencode(paste0(self$getWebDavHostName(),
                                               "c=", uuid))
 
-            headers <- list("Authorization" = paste("OAuth2", self$token))
+            headers <- list("Authorization" = paste("Bearer", self$token))
 
             response <- self$http$exec("PROPFIND", collectionURL, headers,
                                        retryTimes = self$numRetries)
index 1aef20b6cb90fe11d7440219bbe24d464af988c2..aea64323b591ec37f984a981597b261e6059eb5b 100644 (file)
@@ -3,7 +3,7 @@
 # SPDX-License-Identifier: Apache-2.0
 
 getAPIDocument <- function(){
-    url <- "https://4xphq.arvadosapi.com/discovery/v1/apis/arvados/v1/rest"
+    url <- "https://ce8i5.arvadosapi.com/discovery/v1/apis/arvados/v1/rest"
     serverResponse <- httr::RETRY("GET", url = url)
 
     httr::content(serverResponse, as = "parsed", type = "application/json")
index e3457c993f7c88cee4a963ca7006a90c6078f478..da7d52c67d63697bc81aefbcbe16e7713add3891 100644 (file)
@@ -23,7 +23,7 @@ test_that("get always returns NULL", {
     dog <- ArvadosFile$new("dog")
 
     responseIsNull <- is.null(dog$get("something"))
-    expect_that(responseIsNull, is_true())
+    expect_true(responseIsNull)
 })
 
 test_that("getFirst always returns NULL", {
@@ -31,7 +31,7 @@ test_that("getFirst always returns NULL", {
     dog <- ArvadosFile$new("dog")
 
     responseIsNull <- is.null(dog$getFirst())
-    expect_that(responseIsNull, is_true())
+    expect_true(responseIsNull)
 })
 
 test_that(paste("getSizeInBytes returns zero if arvadosFile",
@@ -266,8 +266,8 @@ test_that("move moves arvados file inside collection tree", {
     dogIsNullOnOldLocation <- is.null(collection$get("animal/dog"))
     dogExistsOnNewLocation <- !is.null(collection$get("dog"))
 
-    expect_that(dogIsNullOnOldLocation, is_true())
-    expect_that(dogExistsOnNewLocation, is_true())
+    expect_true(dogIsNullOnOldLocation)
+    expect_true(dogExistsOnNewLocation)
 })
 
 test_that(paste("copy raises exception if arvados file",
@@ -339,8 +339,8 @@ test_that("copy copies arvados file inside collection tree", {
     dogExistsOnOldLocation <- !is.null(collection$get("animal/dog"))
     dogExistsOnNewLocation <- !is.null(collection$get("dog"))
 
-    expect_that(dogExistsOnOldLocation, is_true())
-    expect_that(dogExistsOnNewLocation, is_true())
+    expect_true(dogExistsOnOldLocation)
+    expect_true(dogExistsOnNewLocation)
 })
 
 test_that("duplicate performs deep cloning of Arvados file", {
index 636359ae21a7b196d406ec2b16ee8839e0921f9e..20a2ecf05b120bb769d7f0b8d01c007099638516 100644 (file)
@@ -86,7 +86,7 @@ test_that(paste("add adds ArvadosFile or Subcollection",
     dog <- collection$get("animal/dog")
     dogExistsInCollection <- !is.null(dog) && dog$getName() == "dog"
 
-    expect_that(dogExistsInCollection, is_true())
+    expect_true(dogExistsInCollection)
     expect_that(fakeREST$createCallCount, equals(1))
 })
 
@@ -119,8 +119,8 @@ test_that(paste("create adds files specified by fileNames",
     dogExistsInCollection <- !is.null(dog) && dog$getName() == "dog"
     catExistsInCollection <- !is.null(cat) && cat$getName() == "cat"
 
-    expect_that(dogExistsInCollection, is_true())
-    expect_that(catExistsInCollection, is_true())
+    expect_true(dogExistsInCollection)
+    expect_true(catExistsInCollection)
     expect_that(fakeREST$createCallCount, equals(2))
 })
 
@@ -168,8 +168,8 @@ test_that(paste("remove removes files specified by paths",
     dogExistsInCollection <- !is.null(dog) && dog$getName() == "dog"
     catExistsInCollection <- !is.null(cat) && cat$getName() == "cat"
 
-    expect_that(dogExistsInCollection, is_false())
-    expect_that(catExistsInCollection, is_false())
+    expect_false(dogExistsInCollection)
+    expect_false(catExistsInCollection)
     expect_that(fakeREST$deleteCallCount, equals(2))
 })
 
@@ -188,8 +188,8 @@ test_that(paste("move moves content to a new location inside file tree",
     dogIsNullOnOldLocation <- is.null(collection$get("animal/dog"))
     dogExistsOnNewLocation <- !is.null(collection$get("dog"))
 
-    expect_that(dogIsNullOnOldLocation, is_true())
-    expect_that(dogExistsOnNewLocation, is_true())
+    expect_true(dogIsNullOnOldLocation)
+    expect_true(dogExistsOnNewLocation)
     expect_that(fakeREST$moveCallCount, equals(1))
 })
 
@@ -219,7 +219,7 @@ test_that("getFileListing returns sorted collection content received from REST s
     contentMatchExpected <- all(collection$getFileListing() ==
                                 c("animal", "animal/fish", "ball"))
 
-    expect_that(contentMatchExpected, is_true())
+    expect_true(contentMatchExpected)
     #2 calls because Collection$new calls getFileListing once
     expect_that(fakeREST$getCollectionContentCallCount, equals(2))
 
@@ -237,7 +237,7 @@ test_that("get returns arvados file or subcollection from internal tree structur
     fish <- collection$get("animal/fish")
     fishIsNotNull <- !is.null(fish)
 
-    expect_that(fishIsNotNull, is_true())
+    expect_true(fishIsNotNull)
     expect_that(fish$getName(), equals("fish"))
 })
 
@@ -256,8 +256,8 @@ test_that(paste("copy copies content to a new location inside file tree",
     dogExistsOnOldLocation <- !is.null(collection$get("animal/dog"))
     dogExistsOnNewLocation <- !is.null(collection$get("dog"))
 
-    expect_that(dogExistsOnOldLocation, is_true())
-    expect_that(dogExistsOnNewLocation, is_true())
+    expect_true(dogExistsOnOldLocation)
+    expect_true(dogExistsOnNewLocation)
     expect_that(fakeREST$copyCallCount, equals(1))
 })
 
index 1a3aefecd012325658ad408ee2a699682907dbaf..c4bf9a1da7ff639d62c1bbb135ea77f4326ed4d6 100644 (file)
@@ -34,16 +34,16 @@ test_that("constructor creates file tree from character array properly", {
                                          boat$getCollection()   == "myCollection"
 
     expect_that(root$getName(), equals(""))
-    expect_that(rootIsOfTypeSubcollection, is_true())
-    expect_that(rootHasNoParent, is_true())
-    expect_that(animalIsOfTypeSubcollection, is_true())
-    expect_that(animalsParentIsRoot, is_true())
-    expect_that(animalContainsDog, is_true())
-    expect_that(dogIsOfTypeArvadosFile, is_true())
-    expect_that(dogsParentIsAnimal, is_true())
-    expect_that(boatIsOfTypeArvadosFile, is_true())
-    expect_that(boatsParentIsRoot, is_true())
-    expect_that(allElementsBelongToSameCollection, is_true())
+    expect_true(rootIsOfTypeSubcollection)
+    expect_true(rootHasNoParent)
+    expect_true(animalIsOfTypeSubcollection)
+    expect_true(animalsParentIsRoot)
+    expect_true(animalContainsDog)
+    expect_true(dogIsOfTypeArvadosFile)
+    expect_true(dogsParentIsAnimal)
+    expect_true(boatIsOfTypeArvadosFile)
+    expect_true(boatsParentIsRoot)
+    expect_true(allElementsBelongToSameCollection)
 })
 
 test_that("getElement returns element from tree if element exists on specified path", {
@@ -72,7 +72,7 @@ test_that("getElement returns NULL from tree if element doesn't exists on specif
     fish <- collectionTree$getElement("animal/fish")
     fishIsNULL <- is.null(fish)
 
-    expect_that(fishIsNULL, is_true())
+    expect_true(fishIsNULL)
 })
 
 test_that("getElement trims ./ from start of relativePath", {
index 82c0fb0dd2fed88598e8fd14a8dd88a11d065b71..fb9f379b3623099b1171456b4f4a2b849713773b 100644 (file)
@@ -18,7 +18,7 @@ test_that("parseJSONResponse generates and returns JSON object from server respo
     result <- parser$parseJSONResponse(serverResponse)
     barExists <- !is.null(result$bar)
 
-    expect_that(barExists, is_true())
+    expect_true(barExists)
     expect_that(unlist(result$bar$foo), equals(10))
 })
 
@@ -40,7 +40,7 @@ test_that(paste("parseResponse generates and returns character vector",
 
 webDAVResponseSample =
     paste0("<?xml version=\"1.0\" encoding=\"UTF-8\"?><D:multistatus xmlns:",
-           "D=\"DAV:\"><D:response><D:href>/c=aaaaa-bbbbb-ccccccccccccccc</D",
+           "D=\"DAV:\"><D:response><D:href>/c=aaaaa-bbbbb-ccccccccccccccc/</D",
            ":href><D:propstat><D:prop><D:resourcetype><D:collection xmlns:D=",
            "\"DAV:\"/></D:resourcetype><D:getlastmodified>Fri, 11 Jan 2018 1",
            "1:11:11 GMT</D:getlastmodified><D:displayname></D:displayname><D",
@@ -75,7 +75,7 @@ test_that(paste("getFileNamesFromResponse returns file names belonging to specif
     expectedResult <- "myFile.exe"
     resultMatchExpected <- all.equal(result, expectedResult)
 
-    expect_that(resultMatchExpected, is_true())
+    expect_true(resultMatchExpected)
 })
 
 test_that(paste("getFileSizesFromResponse returns file sizes",
@@ -92,5 +92,5 @@ test_that(paste("getFileSizesFromResponse returns file sizes",
     result <- parser$getFileSizesFromResponse(serverResponse, url)
     resultMatchExpected <- result == expectedResult
 
-    expect_that(resultMatchExpected, is_true())
+    expect_true(resultMatchExpected)
 })
index f12463c805dda10e67325adb2a892d5223600932..eb58d033b5fefdb3f7082f8a4b2838e9dcfec330 100644 (file)
@@ -59,8 +59,8 @@ test_that("exec calls httr functions correctly", {
     http <- HttpRequest$new()
     http$exec("GET", "url")
 
-    expect_that(add_headersCalled, is_true())
-    expect_that(retryCalled, is_true())
+    expect_true(add_headersCalled)
+    expect_true(retryCalled)
     expect_that(expectedConfig$options, equals(list(ssl_verifypeer = 0L)))
 })
 
@@ -101,8 +101,8 @@ test_that("getConnection calls curl functions correctly", {
     http <- HttpRequest$new()
     http$getConnection("location", list(), "r")
 
-    expect_that(new_handleCalled, is_true())
-    expect_that(handle_setheadersCalled, is_true())
-    expect_that(handle_setoptCalled, is_true())
-    expect_that(curlCalled, is_true())
+    expect_true(new_handleCalled)
+    expect_true(handle_setheadersCalled)
+    expect_true(handle_setoptCalled)
+    expect_true(curlCalled)
 })
index 64988e33db2c3c4614112d2eb993687d6e169199..8885ed3de2f5caa906b9d5223878b2fe5d52ccb3 100644 (file)
@@ -10,8 +10,8 @@ context("REST service")
 
 test_that("getWebDavHostName calls REST service properly", {
 
-    expectedURL <- "https://host/discovery/v1/apis/arvados/v1/rest"
-    serverResponse <- list(keepWebServiceUrl = "https://myWebDavServer.com")
+    expectedURL <- "https://host/arvados/v1/config"
+    serverResponse <- list(Services = list(WebDAVDownload = list(ExternalURL = "https://myWebDavServer.com")))
     httpRequest <- FakeHttpRequest$new(expectedURL, serverResponse)
 
     REST <- RESTService$new("token", "host",
@@ -19,14 +19,14 @@ test_that("getWebDavHostName calls REST service properly", {
 
     REST$getWebDavHostName()
 
-    expect_that(httpRequest$URLIsProperlyConfigured, is_true())
-    expect_that(httpRequest$requestHeaderContainsAuthorizationField, is_true())
+    expect_true(httpRequest$URLIsProperlyConfigured)
+    expect_false(httpRequest$requestHeaderContainsAuthorizationField)
     expect_that(httpRequest$numberOfGETRequests, equals(1))
 })
 
 test_that("getWebDavHostName returns webDAV host name properly", {
 
-    serverResponse <- list(keepWebServiceUrl = "https://myWebDavServer.com")
+    serverResponse <- list(Services = list(WebDAVDownload = list(ExternalURL = "https://myWebDavServer.com")))
     httpRequest <- FakeHttpRequest$new(expectedURL = NULL, serverResponse)
 
     REST <- RESTService$new("token", "host",
@@ -48,8 +48,8 @@ test_that("create calls REST service properly", {
 
     REST$create("file", uuid)
 
-    expect_that(fakeHttp$URLIsProperlyConfigured, is_true())
-    expect_that(fakeHttp$requestHeaderContainsAuthorizationField, is_true())
+    expect_true(fakeHttp$URLIsProperlyConfigured)
+    expect_true(fakeHttp$requestHeaderContainsAuthorizationField)
     expect_that(fakeHttp$numberOfPUTRequests, equals(1))
 })
 
@@ -81,8 +81,8 @@ test_that("delete calls REST service properly", {
 
     REST$delete("file", uuid)
 
-    expect_that(fakeHttp$URLIsProperlyConfigured, is_true())
-    expect_that(fakeHttp$requestHeaderContainsAuthorizationField, is_true())
+    expect_true(fakeHttp$URLIsProperlyConfigured)
+    expect_true(fakeHttp$requestHeaderContainsAuthorizationField)
     expect_that(fakeHttp$numberOfDELETERequests, equals(1))
 })
 
@@ -114,9 +114,9 @@ test_that("move calls REST service properly", {
 
     REST$move("file", "newDestination/file", uuid)
 
-    expect_that(fakeHttp$URLIsProperlyConfigured, is_true())
-    expect_that(fakeHttp$requestHeaderContainsAuthorizationField, is_true())
-    expect_that(fakeHttp$requestHeaderContainsDestinationField, is_true())
+    expect_true(fakeHttp$URLIsProperlyConfigured)
+    expect_true(fakeHttp$requestHeaderContainsAuthorizationField)
+    expect_true(fakeHttp$requestHeaderContainsDestinationField)
     expect_that(fakeHttp$numberOfMOVERequests, equals(1))
 })
 
@@ -148,9 +148,9 @@ test_that("copy calls REST service properly", {
 
     REST$copy("file", "newDestination/file", uuid)
 
-    expect_that(fakeHttp$URLIsProperlyConfigured, is_true())
-    expect_that(fakeHttp$requestHeaderContainsAuthorizationField, is_true())
-    expect_that(fakeHttp$requestHeaderContainsDestinationField, is_true())
+    expect_true(fakeHttp$URLIsProperlyConfigured)
+    expect_true(fakeHttp$requestHeaderContainsAuthorizationField)
+    expect_true(fakeHttp$requestHeaderContainsDestinationField)
     expect_that(fakeHttp$numberOfCOPYRequests, equals(1))
 })
 
@@ -187,8 +187,8 @@ test_that("getCollectionContent retreives correct content from WebDAV server", {
     returnedContentMatchExpected <- all.equal(returnResult,
                                               c("animal", "animal/dog", "ball"))
 
-    expect_that(returnedContentMatchExpected, is_true())
-    expect_that(fakeHttp$requestHeaderContainsAuthorizationField, is_true())
+    expect_true(returnedContentMatchExpected)
+    expect_true(fakeHttp$requestHeaderContainsAuthorizationField)
 })
 
 test_that("getCollectionContent raises exception if server returns empty response", {
@@ -266,9 +266,9 @@ test_that("getResourceSize calls REST service properly", {
     returnedContentMatchExpected <- all.equal(returnResult,
                                               c(6, 2, 931, 12003))
 
-    expect_that(fakeHttp$URLIsProperlyConfigured, is_true())
-    expect_that(fakeHttp$requestHeaderContainsAuthorizationField, is_true())
-    expect_that(returnedContentMatchExpected, is_true())
+    expect_true(fakeHttp$URLIsProperlyConfigured)
+    expect_true(fakeHttp$requestHeaderContainsAuthorizationField)
+    expect_true(returnedContentMatchExpected)
 })
 
 test_that("getResourceSize raises exception if server returns empty response", {
@@ -330,9 +330,9 @@ test_that("read calls REST service properly", {
 
     returnResult <- REST$read("file", uuid, "text", 1024, 512)
 
-    expect_that(fakeHttp$URLIsProperlyConfigured, is_true())
-    expect_that(fakeHttp$requestHeaderContainsAuthorizationField, is_true())
-    expect_that(fakeHttp$requestHeaderContainsRangeField, is_true())
+    expect_true(fakeHttp$URLIsProperlyConfigured)
+    expect_true(fakeHttp$requestHeaderContainsAuthorizationField)
+    expect_true(fakeHttp$requestHeaderContainsRangeField)
     expect_that(returnResult, equals("file content"))
 })
 
@@ -390,10 +390,10 @@ test_that("write calls REST service properly", {
 
     REST$write("file", uuid, fileContent, "text/html")
 
-    expect_that(fakeHttp$URLIsProperlyConfigured, is_true())
-    expect_that(fakeHttp$requestBodyIsProvided, is_true())
-    expect_that(fakeHttp$requestHeaderContainsAuthorizationField, is_true())
-    expect_that(fakeHttp$requestHeaderContainsContentTypeField, is_true())
+    expect_true(fakeHttp$URLIsProperlyConfigured)
+    expect_true(fakeHttp$requestBodyIsProvided)
+    expect_true(fakeHttp$requestHeaderContainsAuthorizationField)
+    expect_true(fakeHttp$requestHeaderContainsContentTypeField)
 })
 
 test_that("write raises exception if server response code is not between 200 and 300", {
index a6e420962bce9777d56d69c4ded58c015986b288..a95247f77c7d457d9f368ef321a027a980652e85 100644 (file)
@@ -37,7 +37,7 @@ test_that(paste("getFileListing by default returns sorted path of all files",
     resultsMatch <- length(expectedResult) == length(result) &&
                     all(expectedResult == result)
 
-    expect_that(resultsMatch, is_true())
+    expect_true(resultsMatch)
 })
 
 test_that(paste("getFileListing returns sorted names of all direct children",
@@ -58,7 +58,7 @@ test_that(paste("getFileListing returns sorted names of all direct children",
     resultsMatch <- length(expectedResult) == length(result) &&
                     all(expectedResult == result)
 
-    expect_that(resultsMatch, is_true())
+    expect_true(resultsMatch)
 })
 
 test_that("add adds content to inside collection tree", {
@@ -73,8 +73,8 @@ test_that("add adds content to inside collection tree", {
     animalContainsFish <- animal$get("fish")$getName() == fish$getName()
     animalContainsDog  <- animal$get("dog")$getName()  == dog$getName()
 
-    expect_that(animalContainsFish, is_true())
-    expect_that(animalContainsDog, is_true())
+    expect_true(animalContainsFish)
+    expect_true(animalContainsDog)
 })
 
 test_that("add raises exception if content name is empty string", {
@@ -143,7 +143,7 @@ test_that("remove removes content from subcollection", {
 
     returnValueAfterRemovalIsNull <- is.null(animal$get("fish"))
 
-    expect_that(returnValueAfterRemovalIsNull, is_true())
+    expect_true(returnValueAfterRemovalIsNull)
 })
 
 test_that(paste("remove raises exception",
@@ -198,10 +198,10 @@ test_that(paste("get returns ArvadosFile or Subcollection",
     returnedFishIsSubcollection <- "Subcollection" %in% class(returnedFish)
     returnedDogIsArvadosFile    <- "ArvadosFile"   %in% class(returnedDog)
 
-    expect_that(returnedFishIsSubcollection, is_true())
+    expect_true(returnedFishIsSubcollection)
     expect_that(returnedFish$getName(), equals("fish"))
 
-    expect_that(returnedDogIsArvadosFile, is_true())
+    expect_true(returnedDogIsArvadosFile)
     expect_that(returnedDog$getName(), equals("dog"))
 })
 
@@ -215,7 +215,7 @@ test_that(paste("get returns NULL if file or folder",
 
     returnedDogIsNull <- is.null(animal$get("dog"))
 
-    expect_that(returnedDogIsNull, is_true())
+    expect_true(returnedDogIsNull)
 })
 
 test_that("getFirst returns first child in the subcollection", {
@@ -234,7 +234,7 @@ test_that("getFirst returns NULL if subcollection contains no children", {
 
     returnedElementIsNull <- is.null(animal$getFirst())
 
-    expect_that(returnedElementIsNull, is_true())
+    expect_true(returnedElementIsNull)
 })
 
 test_that(paste("setCollection by default sets collection",
@@ -261,7 +261,7 @@ test_that(paste("setCollection sets collection filed of subcollection only",
     fishCollectionIsNull <- is.null(fish$getCollection())
 
     expect_that(animal$getCollection(), equals("myCollection"))
-    expect_that(fishCollectionIsNull, is_true())
+    expect_true(fishCollectionIsNull)
 })
 
 test_that(paste("move raises exception if subcollection",
@@ -330,8 +330,8 @@ test_that("move moves subcollection inside collection tree", {
     fishIsNullOnOldLocation <- is.null(collection$get("animal/fish"))
     fishExistsOnNewLocation <- !is.null(collection$get("fish"))
 
-    expect_that(fishIsNullOnOldLocation, is_true())
-    expect_that(fishExistsOnNewLocation, is_true())
+    expect_true(fishIsNullOnOldLocation)
+    expect_true(fishExistsOnNewLocation)
 })
 
 test_that(paste("getSizeInBytes returns zero if subcollection",
@@ -425,8 +425,8 @@ test_that("copy copies subcollection inside collection tree", {
     fishExistsOnOldLocation <- !is.null(collection$get("animal/fish"))
     fishExistsOnNewLocation <- !is.null(collection$get("fish"))
 
-    expect_that(fishExistsOnOldLocation, is_true())
-    expect_that(fishExistsOnNewLocation, is_true())
+    expect_true(fishExistsOnOldLocation)
+    expect_true(fishExistsOnNewLocation)
 })
 
 test_that("duplicate performs deep cloning of Subcollection", {