2022-03-05 14:21:16 +00:00
|
|
|
package object_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2023-03-07 11:20:03 +00:00
|
|
|
cidtest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id/test"
|
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object"
|
|
|
|
usertest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/user/test"
|
2022-03-05 14:21:16 +00:00
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestInitCreation(t *testing.T) {
|
|
|
|
var o object.Object
|
2022-04-11 16:25:14 +00:00
|
|
|
cnr := cidtest.ID()
|
2022-04-11 06:30:22 +00:00
|
|
|
own := *usertest.ID()
|
2022-03-05 14:21:16 +00:00
|
|
|
|
|
|
|
object.InitCreation(&o, object.RequiredFields{
|
|
|
|
Container: cnr,
|
|
|
|
Owner: own,
|
|
|
|
})
|
|
|
|
|
2022-04-12 16:23:16 +00:00
|
|
|
cID, set := o.ContainerID()
|
|
|
|
require.True(t, set)
|
|
|
|
require.Equal(t, cnr, cID)
|
2022-03-05 14:21:16 +00:00
|
|
|
require.Equal(t, &own, o.OwnerID())
|
|
|
|
}
|