forked from TrueCloudLab/frostfs-api-go
[#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>
This commit is contained in:
parent
a4349f6692
commit
99370889d1
41 changed files with 1139 additions and 129 deletions
26
object/lock_test.go
Normal file
26
object/lock_test.go
Normal file
|
@ -0,0 +1,26 @@
|
|||
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)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue