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

Function TestBatchOperations

idm/meta/dao/sql/ev-sql_test.go:266–300  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

264}
265
266func TestBatchOperations(t *testing.T) {
267 test.RunStorageTests(evTestcases, t, func(ctx context.Context) {
268 mainDAO, err := manager.Resolve[meta.DAO](ctx)
269 if err != nil {
270 panic(err)
271 }
272 mockDAO := mainDAO.GetEntityValueDao()
273
274 Convey("Create Entity Values Batch", t, func() {
275 createdEntity, err := createTestEntity(ctx, mockDAO, "Batch Entity")
276 So(err, ShouldBeNil)
277
278 values := []*idm.EntityValue{
279 {Label: "Batch Value 1", EntityUuid: createdEntity.Uuid},
280 {Label: "Batch Value 2", EntityUuid: createdEntity.Uuid},
281 {Label: "Batch Value 3", EntityUuid: createdEntity.Uuid},
282 }
283
284 created, err := mockDAO.CreateEntityValues(ctx, values)
285 So(err, ShouldBeNil)
286 So(created, ShouldHaveLength, 3)
287 for i, val := range created {
288 So(val.Uuid, ShouldNotBeEmpty)
289 So(val.Label, ShouldEqual, values[i].Label)
290 So(val.EntityUuid, ShouldEqual, createdEntity.Uuid)
291 }
292 })
293
294 Convey("Create Entity Values Batch Empty", t, func() {
295 created, err := mockDAO.CreateEntityValues(ctx, []*idm.EntityValue{})
296 So(err, ShouldBeNil)
297 So(created, ShouldHaveLength, 0)
298 })
299 })
300}
301
302func TestDeleteOperations(t *testing.T) {
303 test.RunStorageTests(evTestcases, t, func(ctx context.Context) {

Callers

nothing calls this directly

Calls 4

RunStorageTestsFunction · 0.92
createTestEntityFunction · 0.85
GetEntityValueDaoMethod · 0.65
CreateEntityValuesMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…