Skip to content

Commit

Permalink
test: add more tests for the DrivesDriveItemService implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
fschade authored and rhafer committed Feb 6, 2024
1 parent 3f1e727 commit 5900a6a
Show file tree
Hide file tree
Showing 4 changed files with 430 additions and 10 deletions.
19 changes: 13 additions & 6 deletions services/graph/.mockery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,20 @@ outpkg: "mocks"
packages:
github.com/owncloud/ocis/v2/services/graph/pkg/service/v0:
config:
dir: "mocks"
dir: "mocks"
interfaces:
DrivesDriveItemProvider:
HTTPClient:
Permissions:
Publisher:
RoleService:
DrivesDriveItemProvider:
HTTPClient:
Permissions:
Publisher:
RoleService:
github.com/cs3org/reva/v2/pkg/rgrpc/todo/pool:
config:
dir: "mocks"
interfaces:
Selectable:
config:
filename: "gateway_selector.go"
github.com/owncloud/ocis/v2/services/graph/pkg/identity:
config:
dir: "pkg/identity/mocks"
Expand Down
104 changes: 104 additions & 0 deletions services/graph/mocks/gateway_selector.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions services/graph/pkg/service/v0/api_drives_drive_item.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ import (
gateway "github.com/cs3org/go-cs3apis/cs3/gateway/v1beta1"
collaboration "github.com/cs3org/go-cs3apis/cs3/sharing/collaboration/v1beta1"
storageprovider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
"github.com/cs3org/reva/v2/pkg/rgrpc/todo/pool"
"github.com/cs3org/reva/v2/pkg/storagespace"
"github.com/cs3org/reva/v2/pkg/utils"
"github.com/go-chi/render"
libregraph "github.com/owncloud/libre-graph-api-go"
"google.golang.org/protobuf/types/known/fieldmaskpb"

"github.com/cs3org/reva/v2/pkg/rgrpc/todo/pool"
"github.com/cs3org/reva/v2/pkg/storagespace"
"github.com/cs3org/reva/v2/pkg/utils"

"github.com/owncloud/ocis/v2/ocis-pkg/log"
"github.com/owncloud/ocis/v2/services/graph/pkg/errorcode"
)
Expand Down Expand Up @@ -199,6 +200,8 @@ func (api DrivesDriveItemApi) DeleteDriveItem(w http.ResponseWriter, r *http.Req
return
}

// fixMe: check if itemID is a share jail?

if err := api.drivesDriveItemService.UnmountShare(ctx, itemID); err != nil {
msg := "unmounting share failed"
api.logger.Debug().Err(err).Msg(msg)
Expand Down
Loading

0 comments on commit 5900a6a

Please sign in to comment.