[#346] Upgrade NeoFS SDK Go library
Core changes: - `object.ID` moved to new package `oid`; - `object.Address` moved to new package `address`; - `pool.Object` interface changes. Additionally: - Set container owner in `Agent.IssueSecret`. - Remove no longer needed fields from `GetObjectParams` - `Length` and `Offset` are never assigned. These values are set in `Range` field. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
6a4fba4d09
commit
34a221c5c9
28 changed files with 430 additions and 518 deletions
14
api/cache/objects_test.go
vendored
14
api/cache/objects_test.go
vendored
|
@ -4,7 +4,7 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/nspcc-dev/neofs-sdk-go/object"
|
||||
"github.com/nspcc-dev/neofs-sdk-go/object/address"
|
||||
objecttest "github.com/nspcc-dev/neofs-sdk-go/object/test"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
@ -18,16 +18,16 @@ func getTestConfig() *Config {
|
|||
|
||||
func TestCache(t *testing.T) {
|
||||
obj := objecttest.Object()
|
||||
address := object.NewAddress()
|
||||
address.SetContainerID(obj.ContainerID())
|
||||
address.SetObjectID(obj.ID())
|
||||
addr := address.NewAddress()
|
||||
addr.SetContainerID(obj.ContainerID())
|
||||
addr.SetObjectID(obj.ID())
|
||||
|
||||
t.Run("check get", func(t *testing.T) {
|
||||
cache := New(getTestConfig())
|
||||
err := cache.Put(*obj)
|
||||
require.NoError(t, err)
|
||||
|
||||
actual := cache.Get(address)
|
||||
actual := cache.Get(addr)
|
||||
require.Equal(t, obj, actual)
|
||||
})
|
||||
|
||||
|
@ -36,8 +36,8 @@ func TestCache(t *testing.T) {
|
|||
err := cache.Put(*obj)
|
||||
require.NoError(t, err)
|
||||
|
||||
cache.Delete(address)
|
||||
actual := cache.Get(address)
|
||||
cache.Delete(addr)
|
||||
actual := cache.Get(addr)
|
||||
require.Nil(t, actual)
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue