MCPcopy Create free account
hub / github.com/pydio/cells / TestHandlerWithPrefix

Function TestHandlerWithPrefix

data/source/objects/handler_test.go:137–191  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

135}
136
137func TestHandlerWithPrefix(t *testing.T) {
138 initTree()
139 rootedFs := afero.NewBasePathFs(fs, "folder1")
140 handler = FsBrowser{FS: rootedFs}
141
142 Convey("Create Node", t, func() {
143 _, err := handler.CreateNode(ctx, &tree.CreateNodeRequest{Node: &tree.Node{
144 Type: tree.NodeType_COLLECTION,
145 Path: "subfolder/subsubfolder1",
146 Uuid: "shfuuid1",
147 }})
148 So(err, ShouldBeNil)
149 })
150
151 Convey("Read Node", t, func() {
152 resp, err := handler.ReadNode(ctx, &tree.ReadNodeRequest{
153 Node: &tree.Node{
154 Path: "subfolder/file",
155 },
156 })
157 So(err, ShouldBeNil)
158 So(resp.Node.Size, ShouldEqual, 1024)
159 })
160
161 Convey("Update Node", t, func() {
162 _, err := handler.UpdateNode(ctx, &tree.UpdateNodeRequest{
163 From: &tree.Node{
164 Path: "subfolder/file",
165 },
166 To: &tree.Node{
167 Path: "subfolder/file2",
168 },
169 })
170 So(err, ShouldNotBeNil)
171 })
172
173 Convey("Delete Node", t, func() {
174 resp, err := handler.DeleteNode(ctx, &tree.DeleteNodeRequest{
175 Node: &tree.Node{
176 Path: "subfolder",
177 },
178 })
179 So(err, ShouldBeNil)
180 So(resp.Success, ShouldBeTrue)
181
182 _, err = handler.ReadNode(ctx, &tree.ReadNodeRequest{
183 Node: &tree.Node{
184 Path: "subfolder",
185 },
186 })
187 So(err, ShouldNotBeNil)
188 })
189
190 Convey("List Nodes", t, func() {})
191}

Callers

nothing calls this directly

Calls 5

initTreeFunction · 0.85
CreateNodeMethod · 0.65
ReadNodeMethod · 0.65
UpdateNodeMethod · 0.65
DeleteNodeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…