[#401] test: Randomize value for oneof
field
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
0b8e4e4753
commit
d35e935a9d
3 changed files with 49 additions and 5 deletions
|
@ -2,6 +2,7 @@ package sessiontest
|
|||
|
||||
import (
|
||||
acltest "github.com/nspcc-dev/neofs-api-go/v2/acl/test"
|
||||
"github.com/nspcc-dev/neofs-api-go/v2/internal"
|
||||
refstest "github.com/nspcc-dev/neofs-api-go/v2/refs/test"
|
||||
"github.com/nspcc-dev/neofs-api-go/v2/session"
|
||||
statustest "github.com/nspcc-dev/neofs-api-go/v2/status/test"
|
||||
|
@ -165,7 +166,13 @@ func GenerateSessionTokenBody(empty bool) *session.TokenBody {
|
|||
m.SetSessionKey([]byte{2})
|
||||
m.SetOwnerID(refstest.GenerateOwnerID(false))
|
||||
m.SetLifetime(GenerateTokenLifetime(false))
|
||||
m.SetContext(GenerateObjectSessionContext(false))
|
||||
|
||||
switch internal.RandUint32(2) {
|
||||
case 0:
|
||||
m.SetContext(GenerateObjectSessionContext(false))
|
||||
case 1:
|
||||
m.SetContext(GenerateContainerSessionContext(false))
|
||||
}
|
||||
}
|
||||
|
||||
return m
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue