Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Richter <[email protected]>
  • Loading branch information
dragonchaser committed Oct 18, 2023
1 parent 68fb38f commit 832157f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -228,4 +228,4 @@ require (
)

// the replacement build is based on https://github.com/dragonchaser/cs3apis/tree/master
replace github.com/cs3org/go-cs3apis => github.com/dragonchaser/go-cs3apis v0.0.0-20231013070415-81bad5867684
replace github.com/cs3org/go-cs3apis => github.com/dragonchaser/go-cs3apis v0.0.0-20231018101134-aadeeb03233c
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -529,8 +529,8 @@ github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUn
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/dragonchaser/go-cs3apis v0.0.0-20231013070415-81bad5867684 h1:F0zuwlUK3+8uKKki+/+VYWnbDutbS1z8SR4iiJN4syE=
github.com/dragonchaser/go-cs3apis v0.0.0-20231013070415-81bad5867684/go.mod h1:TKUgPjk4kNU0KLd9ZxoFE74Wv6PiXckF4RB3749FztA=
github.com/dragonchaser/go-cs3apis v0.0.0-20231018101134-aadeeb03233c h1:W12nbHzbDqM4WNDtEUNJXEzLK//0JpvKp0OdGc/yvwA=
github.com/dragonchaser/go-cs3apis v0.0.0-20231018101134-aadeeb03233c/go.mod h1:TKUgPjk4kNU0KLd9ZxoFE74Wv6PiXckF4RB3749FztA=
github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o=
Expand Down
26 changes: 13 additions & 13 deletions pkg/share/manager/jsoncs3/jsoncs3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,7 @@ var _ = Describe("Jsoncs3", func() {
})
Expect(err).ToNot(HaveOccurred())
Expect(rs.MountPoint.Path).To(Equal("newMP"))
Expect(rs.Share.Hidden).To(Equal(false))
Expect(rs.Hidden).To(Equal(false))
})

It("hides the share", func() {
Expand All @@ -972,12 +972,12 @@ var _ = Describe("Jsoncs3", func() {
rs.MountPoint = &providerv1beta1.Reference{
Path: "newMP",
}
rs.Share.Hidden = true
rs.Hidden = true

rs, err = m.UpdateReceivedShare(granteeCtx, rs, &fieldmaskpb.FieldMask{Paths: []string{"hidden", "mount_point"}}, nil)
Expect(err).ToNot(HaveOccurred())
Expect(rs.MountPoint.Path).To(Equal("newMP"))
Expect(rs.Share.Hidden).To(Equal(true))
Expect(rs.Hidden).To(Equal(true))

rs, err = m.GetReceivedShare(granteeCtx, &collaboration.ShareReference{
Spec: &collaboration.ShareReference_Id{
Expand All @@ -986,7 +986,7 @@ var _ = Describe("Jsoncs3", func() {
})
Expect(err).ToNot(HaveOccurred())
Expect(rs.MountPoint.Path).To(Equal("newMP"))
Expect(rs.Share.Hidden).To(Equal(true))
Expect(rs.Hidden).To(Equal(true))
})

It("handles invalid field masks", func() {
Expand Down Expand Up @@ -1071,11 +1071,11 @@ var _ = Describe("Jsoncs3", func() {
Expect(rs.State).To(Equal(collaboration.ShareState_SHARE_STATE_PENDING))

rs.State = collaboration.ShareState_SHARE_STATE_ACCEPTED
rs.Share.Hidden = true
rs.Hidden = true
rs, err = m.UpdateReceivedShare(granteeCtx, rs, &fieldmaskpb.FieldMask{Paths: []string{"state", "hidden"}}, nil)
Expect(err).ToNot(HaveOccurred())
Expect(rs.State).To(Equal(collaboration.ShareState_SHARE_STATE_ACCEPTED))
Expect(rs.Share.Hidden).To(Equal(true))
Expect(rs.Hidden).To(Equal(true))

m, err := jsoncs3.New(storage, nil, 0, nil, 0) // Reset in-memory cache
Expect(err).ToNot(HaveOccurred())
Expand All @@ -1085,7 +1085,7 @@ var _ = Describe("Jsoncs3", func() {
Id: gshare.Id,
},
})
Expect(rs.Share.Hidden).To(Equal(true))
Expect(rs.Hidden).To(Equal(true))
Expect(err).ToNot(HaveOccurred())
Expect(rs.State).To(Equal(collaboration.ShareState_SHARE_STATE_ACCEPTED))
})
Expand All @@ -1100,11 +1100,11 @@ var _ = Describe("Jsoncs3", func() {
Expect(rs.State).To(Equal(collaboration.ShareState_SHARE_STATE_PENDING))

rs.State = collaboration.ShareState_SHARE_STATE_ACCEPTED
rs.Share.Hidden = true
rs.Hidden = true
rs, err = m.UpdateReceivedShare(granteeCtx, rs, &fieldmaskpb.FieldMask{Paths: []string{"state", "hidden"}}, nil)
Expect(err).ToNot(HaveOccurred())
Expect(rs.State).To(Equal(collaboration.ShareState_SHARE_STATE_ACCEPTED))
Expect(rs.Share.Hidden).To(Equal(true))
Expect(rs.Hidden).To(Equal(true))

m, err := jsoncs3.New(storage, nil, 0, nil, 0) // Reset in-memory cache
Expect(err).ToNot(HaveOccurred())
Expand All @@ -1114,22 +1114,22 @@ var _ = Describe("Jsoncs3", func() {
Id: gshare.Id,
},
})
Expect(rs.Share.Hidden).To(Equal(true))
Expect(rs.Hidden).To(Equal(true))
Expect(err).ToNot(HaveOccurred())
Expect(rs.State).To(Equal(collaboration.ShareState_SHARE_STATE_ACCEPTED))

rs.Share.Hidden = false
rs.Hidden = false
rs, err = m.UpdateReceivedShare(granteeCtx, rs, &fieldmaskpb.FieldMask{Paths: []string{"state", "hidden"}}, nil)
Expect(err).ToNot(HaveOccurred())
Expect(rs.State).To(Equal(collaboration.ShareState_SHARE_STATE_ACCEPTED))
Expect(rs.Share.Hidden).To(Equal(false))
Expect(rs.Hidden).To(Equal(false))

rs, err = m.GetReceivedShare(granteeCtx, &collaboration.ShareReference{
Spec: &collaboration.ShareReference_Id{
Id: gshare.Id,
},
})
Expect(rs.Share.Hidden).To(Equal(false))
Expect(rs.Hidden).To(Equal(false))
Expect(err).ToNot(HaveOccurred())
Expect(rs.State).To(Equal(collaboration.ShareState_SHARE_STATE_ACCEPTED))
})
Expand Down

0 comments on commit 832157f

Please sign in to comment.