frostfs-sdk-go/object/object_test.go
Pavel Karpy 4c779423f5 Move to frostfs-sdk-go
Signed-off-by: Pavel Karpy <p.karpy@yadro.com>
2022-12-14 09:59:29 +03:00

26 lines
573 B
Go

package object_test
import (
"testing"
cidtest "github.com/TrueCloudLab/frostfs-sdk-go/container/id/test"
"github.com/TrueCloudLab/frostfs-sdk-go/object"
usertest "github.com/TrueCloudLab/frostfs-sdk-go/user/test"
"github.com/stretchr/testify/require"
)
func TestInitCreation(t *testing.T) {
var o object.Object
cnr := cidtest.ID()
own := *usertest.ID()
object.InitCreation(&o, object.RequiredFields{
Container: cnr,
Owner: own,
})
cID, set := o.ContainerID()
require.True(t, set)
require.Equal(t, cnr, cID)
require.Equal(t, &own, o.OwnerID())
}