diff --git a/pkg/session/test/container.go b/pkg/session/test/container.go new file mode 100644 index 00000000..070bd1b0 --- /dev/null +++ b/pkg/session/test/container.go @@ -0,0 +1,26 @@ +package sessiontest + +import ( + "math/rand" + + cidtest "github.com/nspcc-dev/neofs-api-go/pkg/container/id/test" + "github.com/nspcc-dev/neofs-api-go/pkg/session" +) + +// ContainerContext returns session.ContainerContext +// which applies to random operation on a random container. +func ContainerContext() *session.ContainerContext { + c := session.NewContainerContext() + + setters := []func(){ + c.ForPut, + c.ForDelete, + c.ForSetEACL, + } + + setters[rand.Uint32()%uint32(len(setters))]() + + c.ApplyTo(cidtest.Generate()) + + return c +}