Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Richter <crichter@owncloud.com>
  • Loading branch information
dragonchaser committed Mar 14, 2024
1 parent b0c0c7a commit 069dbea
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions internal/http/services/owncloud/ocdav/ocdav_blackbox_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"context"
"errors"
"fmt"
"google.golang.org/grpc"
"net/http"
"net/http/httptest"
"path"
Expand Down Expand Up @@ -958,14 +959,20 @@ var _ = Describe("ocdav", func() {
req.Header.Set(net.HeaderDestination, basePath+dstPath)
req.Header.Set("Overwrite", "T")

client.On("GetPath", mock.Anything, mock.Anything).Return(&cs3storageprovider.GetPathResponse{
Status: status.NewOK(ctx),
Path: "/file",
}, nil).Once()
client.On("GetPath", mock.Anything, mock.Anything).Return(&cs3storageprovider.GetPathResponse{
Status: status.NewOK(ctx),
Path: "/dstFileName",
}, nil).Once()
client.On("GetPath", mock.Anything, mock.Anything).Return(func(ctx context.Context, req *cs3storageprovider.GetPathRequest, _ ...grpc.CallOption) (*cs3storageprovider.GetPathResponse, error) {
switch req.ResourceId.OpaqueId {
case "dstId":
return &cs3storageprovider.GetPathResponse{
Status: status.NewOK(ctx),
Path: "/dstFileName",
}, nil
default:
return &cs3storageprovider.GetPathResponse{
Status: status.NewOK(ctx),
Path: "/file",
}, nil
}
})

client.On("Stat", mock.Anything, mock.MatchedBy(func(req *cs3storageprovider.StatRequest) bool {
return req.Ref.Path == mReq.Source.Path
Expand Down

0 comments on commit 069dbea

Please sign in to comment.