f7172adf18
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
27 lines
525 B
Go
27 lines
525 B
Go
package sessiontest
|
|
|
|
import (
|
|
"math/rand"
|
|
|
|
cidtest "github.com/nspcc-dev/neofs-sdk-go/container/id/test"
|
|
"github.com/nspcc-dev/neofs-sdk-go/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))]()
|
|
|
|
cID := cidtest.ID()
|
|
c.ApplyTo(&cID)
|
|
|
|
return c
|
|
}
|