[#155] sdk/object: Add session token getter/setter

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-09-22 13:53:10 +03:00 committed by Leonard Lyubich
parent 3347e53cde
commit c66b23995c
3 changed files with 36 additions and 2 deletions

View file

@ -8,6 +8,7 @@ import (
"github.com/nspcc-dev/neofs-api-go/pkg"
"github.com/nspcc-dev/neofs-api-go/pkg/container"
"github.com/nspcc-dev/neofs-api-go/pkg/owner"
"github.com/nspcc-dev/neofs-api-go/pkg/token"
"github.com/nspcc-dev/neofs-api-go/v2/object"
"github.com/stretchr/testify/require"
)
@ -202,3 +203,14 @@ func TestRawObject_ToV2(t *testing.T) {
require.Equal(t, objV2, obj.ToV2())
}
func TestRawObject_SetSessionToken(t *testing.T) {
obj := NewRaw()
tok := token.NewSessionToken()
tok.SetID([]byte{1, 2, 3})
obj.SetSessionToken(tok)
require.Equal(t, tok, obj.GetSessionToken())
}