frostfs-api-go/object/lock_test.go
Leonard Lyubich 99370889d1 [#371] Support recent changes in NeoFS API protocol
Support:
  * new status codes (object, container, session);
  * object `Lock` message;
  * different signature schemes.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2022-02-25 10:24:07 +03:00

26 lines
476 B
Go

package object_test
import (
"testing"
"github.com/nspcc-dev/neofs-api-go/v2/object"
objecttest "github.com/nspcc-dev/neofs-api-go/v2/object/test"
"github.com/stretchr/testify/require"
)
func TestLockRW(t *testing.T) {
var l object.Lock
var obj object.Object
require.Error(t, object.ReadLock(&l, obj))
l = *objecttest.GenerateLock(false)
object.WriteLock(&obj, l)
var l2 object.Lock
require.NoError(t, object.ReadLock(&l2, obj))
require.Equal(t, l, l2)
}