forked from TrueCloudLab/frostfs-s3-gw
[#253] Caches refactoring
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
parent
951eb6fda8
commit
19b917e3b5
30 changed files with 365 additions and 322 deletions
|
@ -6,7 +6,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/nspcc-dev/neofs-api-go/pkg/object"
|
||||
"github.com/nspcc-dev/neofs-s3-gw/api"
|
||||
"github.com/nspcc-dev/neofs-s3-gw/api/data"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
|
@ -26,11 +26,11 @@ func randSHA256Checksum(t *testing.T) (cs [sha256.Size]byte) {
|
|||
|
||||
func TestTrimAfterObjectName(t *testing.T) {
|
||||
var (
|
||||
objects []*api.ObjectInfo
|
||||
objects []*data.ObjectInfo
|
||||
names = []string{"b", "c", "d"}
|
||||
)
|
||||
for _, name := range names {
|
||||
objects = append(objects, &api.ObjectInfo{Name: name})
|
||||
objects = append(objects, &data.ObjectInfo{Name: name})
|
||||
}
|
||||
|
||||
t.Run("startafter before all objects", func(t *testing.T) {
|
||||
|
@ -59,7 +59,7 @@ func TestTrimAfterObjectName(t *testing.T) {
|
|||
})
|
||||
|
||||
t.Run("empty objects", func(t *testing.T) {
|
||||
actual := trimAfterObjectName(names[0], []*api.ObjectInfo{})
|
||||
actual := trimAfterObjectName(names[0], []*data.ObjectInfo{})
|
||||
require.Nil(t, actual)
|
||||
})
|
||||
|
||||
|
@ -76,14 +76,14 @@ func TestTrimAfterObjectName(t *testing.T) {
|
|||
|
||||
func TestTrimAfterObjectID(t *testing.T) {
|
||||
var (
|
||||
objects []*api.ObjectInfo
|
||||
objects []*data.ObjectInfo
|
||||
ids []*object.ID
|
||||
numberOfIDS = 3
|
||||
)
|
||||
|
||||
for i := 0; i < numberOfIDS; i++ {
|
||||
id := randID(t)
|
||||
objects = append(objects, &api.ObjectInfo{ID: id})
|
||||
objects = append(objects, &data.ObjectInfo{ID: id})
|
||||
ids = append(ids, id)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue