X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/6459c61b9cca7d2382d01c20d1f749a7dc8d21e0..74fec3cd8284eae4829dad2c287588d52c621c4b:/sdk/R/tests/testthat/fakes/FakeRESTService.R diff --git a/sdk/R/tests/testthat/fakes/FakeRESTService.R b/sdk/R/tests/testthat/fakes/FakeRESTService.R index d370e87fbe..095392661a 100644 --- a/sdk/R/tests/testthat/fakes/FakeRESTService.R +++ b/sdk/R/tests/testthat/fakes/FakeRESTService.R @@ -1,3 +1,7 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + FakeRESTService <- R6::R6Class( "FakeRESTService", @@ -14,6 +18,7 @@ FakeRESTService <- R6::R6Class( createCallCount = NULL, deleteCallCount = NULL, moveCallCount = NULL, + copyCallCount = NULL, getCollectionContentCallCount = NULL, getResourceSizeCallCount = NULL, readCallCount = NULL, @@ -27,7 +32,7 @@ FakeRESTService <- R6::R6Class( collectionContent = NULL, returnContent = NULL, - initialize = function(collectionContent = NULL, returnContent = NULL, + initialize = function(collectionContent = NULL, returnContent = NULL, expectedFilterContent = NULL) { self$getResourceCallCount <- 0 @@ -40,6 +45,7 @@ FakeRESTService <- R6::R6Class( self$createCallCount <- 0 self$deleteCallCount <- 0 self$moveCallCount <- 0 + self$copyCallCount <- 0 self$getCollectionContentCallCount <- 0 self$getResourceSizeCallCount <- 0 self$readCallCount <- 0 @@ -131,7 +137,13 @@ FakeRESTService <- R6::R6Class( self$returnContent }, - getCollectionContent = function(uuid) + copy = function(from, to, uuid) + { + self$copyCallCount <- self$copyCallCount + 1 + self$returnContent + }, + + getCollectionContent = function(uuid, relativePath = NULL) { self$getCollectionContentCallCount <- self$getCollectionContentCallCount + 1 self$collectionContent @@ -142,21 +154,21 @@ FakeRESTService <- R6::R6Class( self$getResourceSizeCallCount <- self$getResourceSizeCallCount + 1 self$returnContent }, - + read = function(relativePath, uuid, contentType = "text", offset = 0, length = 0) { self$readCallCount <- self$readCallCount + 1 self$returnContent }, - write = function(uuid, relativePath, content, contentType) + write = function(relativePath, uuid, content, contentType) { self$writeBuffer <- content self$writeCallCount <- self$writeCallCount + 1 self$returnContent }, - getConnection = function(relativePath, uuid, openMode) + getConnection = function(uuid, relativePath, openMode) { self$getConnectionCallCount <- self$getConnectionCallCount + 1 self$returnContent