From 6d3d91f889ac56ee3b59376b01275699dba8974c Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Tue, 1 Feb 2022 13:15:12 +0300 Subject: [PATCH] [#128] *: Use correct aliases for object testing Signed-off-by: Pavel Karpy --- audit/result_test.go | 6 +++--- audit/test/generate.go | 6 +++--- eacl/record_test.go | 4 ++-- object/test/generate.go | 18 +++++++++--------- session/object_test.go | 4 ++-- session/test/object.go | 4 ++-- storagegroup/storagegroup_test.go | 4 ++-- storagegroup/test/generate.go | 4 ++-- 8 files changed, 25 insertions(+), 25 deletions(-) diff --git a/audit/result_test.go b/audit/result_test.go index b661167..c9e37bc 100644 --- a/audit/result_test.go +++ b/audit/result_test.go @@ -8,7 +8,7 @@ import ( audittest "github.com/nspcc-dev/neofs-sdk-go/audit/test" cidtest "github.com/nspcc-dev/neofs-sdk-go/container/id/test" oid "github.com/nspcc-dev/neofs-sdk-go/object/id" - "github.com/nspcc-dev/neofs-sdk-go/object/id/test" + oidtest "github.com/nspcc-dev/neofs-sdk-go/object/id/test" "github.com/nspcc-dev/neofs-sdk-go/version" "github.com/stretchr/testify/require" ) @@ -40,11 +40,11 @@ func TestResult(t *testing.T) { r.SetRetries(retries) require.Equal(t, retries, r.Retries()) - passSG := []*oid.ID{test.ID(), test.ID()} + passSG := []*oid.ID{oidtest.ID(), oidtest.ID()} r.SetPassSG(passSG) require.Equal(t, passSG, r.PassSG()) - failSG := []*oid.ID{test.ID(), test.ID()} + failSG := []*oid.ID{oidtest.ID(), oidtest.ID()} r.SetFailSG(failSG) require.Equal(t, failSG, r.FailSG()) diff --git a/audit/test/generate.go b/audit/test/generate.go index 8ae63b1..76affc3 100644 --- a/audit/test/generate.go +++ b/audit/test/generate.go @@ -4,7 +4,7 @@ import ( "github.com/nspcc-dev/neofs-sdk-go/audit" cidtest "github.com/nspcc-dev/neofs-sdk-go/container/id/test" oid "github.com/nspcc-dev/neofs-sdk-go/object/id" - "github.com/nspcc-dev/neofs-sdk-go/object/id/test" + oidtest "github.com/nspcc-dev/neofs-sdk-go/object/id/test" versiontest "github.com/nspcc-dev/neofs-sdk-go/version/test" ) @@ -30,8 +30,8 @@ func Result() *audit.Result { []byte("node3"), []byte("node4"), }) - x.SetPassSG([]*oid.ID{test.ID(), test.ID()}) - x.SetFailSG([]*oid.ID{test.ID(), test.ID()}) + x.SetPassSG([]*oid.ID{oidtest.ID(), oidtest.ID()}) + x.SetFailSG([]*oid.ID{oidtest.ID(), oidtest.ID()}) return x } diff --git a/eacl/record_test.go b/eacl/record_test.go index 383e323..73b7c8b 100644 --- a/eacl/record_test.go +++ b/eacl/record_test.go @@ -10,7 +10,7 @@ import ( checksumtest "github.com/nspcc-dev/neofs-sdk-go/checksum/test" cidtest "github.com/nspcc-dev/neofs-sdk-go/container/id/test" "github.com/nspcc-dev/neofs-sdk-go/object" - "github.com/nspcc-dev/neofs-sdk-go/object/id/test" + oidtest "github.com/nspcc-dev/neofs-sdk-go/object/id/test" ownertest "github.com/nspcc-dev/neofs-sdk-go/owner/test" versiontest "github.com/nspcc-dev/neofs-sdk-go/version/test" "github.com/stretchr/testify/require" @@ -156,7 +156,7 @@ func TestRecord_ToV2(t *testing.T) { func TestReservedRecords(t *testing.T) { var ( v = versiontest.Version() - oid = test.ID() + oid = oidtest.ID() cid = cidtest.ID() ownerid = ownertest.ID() h = checksumtest.Checksum() diff --git a/object/test/generate.go b/object/test/generate.go index 11a8925..8d34010 100644 --- a/object/test/generate.go +++ b/object/test/generate.go @@ -6,7 +6,7 @@ import ( cidtest "github.com/nspcc-dev/neofs-sdk-go/container/id/test" "github.com/nspcc-dev/neofs-sdk-go/object" oid "github.com/nspcc-dev/neofs-sdk-go/object/id" - "github.com/nspcc-dev/neofs-sdk-go/object/id/test" + oidtest "github.com/nspcc-dev/neofs-sdk-go/object/id/test" ownertest "github.com/nspcc-dev/neofs-sdk-go/owner/test" sessiontest "github.com/nspcc-dev/neofs-sdk-go/session/test" sigtest "github.com/nspcc-dev/neofs-sdk-go/signature/test" @@ -45,7 +45,7 @@ func SplitID() *object.SplitID { func generateRaw(withParent bool) *object.RawObject { x := object.NewRaw() - x.SetID(test.ID()) + x.SetID(oidtest.ID()) x.SetSessionToken(sessiontest.Token()) x.SetPayload([]byte{1, 2, 3}) x.SetOwnerID(ownertest.ID()) @@ -54,9 +54,9 @@ func generateRaw(withParent bool) *object.RawObject { x.SetVersion(version.Current()) x.SetPayloadSize(111) x.SetCreationEpoch(222) - x.SetPreviousID(test.ID()) - x.SetParentID(test.ID()) - x.SetChildren(test.ID(), test.ID()) + x.SetPreviousID(oidtest.ID()) + x.SetParentID(oidtest.ID()) + x.SetChildren(oidtest.ID(), oidtest.ID()) x.SetAttributes(Attribute(), Attribute()) x.SetSplitID(SplitID()) x.SetPayloadChecksum(checksumtest.Checksum()) @@ -86,7 +86,7 @@ func Tombstone() *object.Tombstone { x.SetSplitID(SplitID()) x.SetExpirationEpoch(13) - x.SetMembers([]*oid.ID{test.ID(), test.ID()}) + x.SetMembers([]*oid.ID{oidtest.ID(), oidtest.ID()}) return x } @@ -96,8 +96,8 @@ func SplitInfo() *object.SplitInfo { x := object.NewSplitInfo() x.SetSplitID(SplitID()) - x.SetLink(test.ID()) - x.SetLastPart(test.ID()) + x.SetLink(oidtest.ID()) + x.SetLastPart(oidtest.ID()) return x } @@ -106,7 +106,7 @@ func SplitInfo() *object.SplitInfo { func SearchFilters() object.SearchFilters { x := object.NewSearchFilters() - x.AddObjectIDFilter(object.MatchStringEqual, test.ID()) + x.AddObjectIDFilter(object.MatchStringEqual, oidtest.ID()) x.AddObjectContainerIDFilter(object.MatchStringNotEqual, cidtest.ID()) return x diff --git a/session/object_test.go b/session/object_test.go index 0e25662..929da16 100644 --- a/session/object_test.go +++ b/session/object_test.go @@ -4,7 +4,7 @@ import ( "testing" v2session "github.com/nspcc-dev/neofs-api-go/v2/session" - objecttest "github.com/nspcc-dev/neofs-sdk-go/object/address/test" + addresstest "github.com/nspcc-dev/neofs-sdk-go/object/address/test" "github.com/nspcc-dev/neofs-sdk-go/session" sessiontest "github.com/nspcc-dev/neofs-sdk-go/session/test" "github.com/stretchr/testify/require" @@ -52,7 +52,7 @@ func TestObjectContextVerbs(t *testing.T) { func TestObjectContext_ApplyTo(t *testing.T) { c := session.NewObjectContext() - id := objecttest.Address() + id := addresstest.Address() t.Run("method", func(t *testing.T) { c.ApplyTo(id) diff --git a/session/test/object.go b/session/test/object.go index d6c9514..e79820d 100644 --- a/session/test/object.go +++ b/session/test/object.go @@ -3,7 +3,7 @@ package sessiontest import ( "math/rand" - oidtest "github.com/nspcc-dev/neofs-sdk-go/object/address/test" + addresstest "github.com/nspcc-dev/neofs-sdk-go/object/address/test" "github.com/nspcc-dev/neofs-sdk-go/session" ) @@ -24,7 +24,7 @@ func ObjectContext() *session.ObjectContext { setters[rand.Uint32()%uint32(len(setters))]() - c.ApplyTo(oidtest.Address()) + c.ApplyTo(addresstest.Address()) return c } diff --git a/storagegroup/storagegroup_test.go b/storagegroup/storagegroup_test.go index cd3acff..2418b5a 100644 --- a/storagegroup/storagegroup_test.go +++ b/storagegroup/storagegroup_test.go @@ -6,7 +6,7 @@ import ( storagegroupV2 "github.com/nspcc-dev/neofs-api-go/v2/storagegroup" checksumtest "github.com/nspcc-dev/neofs-sdk-go/checksum/test" oid "github.com/nspcc-dev/neofs-sdk-go/object/id" - "github.com/nspcc-dev/neofs-sdk-go/object/id/test" + oidtest "github.com/nspcc-dev/neofs-sdk-go/object/id/test" "github.com/nspcc-dev/neofs-sdk-go/storagegroup" storagegrouptest "github.com/nspcc-dev/neofs-sdk-go/storagegroup/test" "github.com/stretchr/testify/require" @@ -27,7 +27,7 @@ func TestStorageGroup(t *testing.T) { sg.SetExpirationEpoch(exp) require.Equal(t, exp, sg.ExpirationEpoch()) - members := []*oid.ID{test.ID(), test.ID()} + members := []*oid.ID{oidtest.ID(), oidtest.ID()} sg.SetMembers(members) require.Equal(t, members, sg.Members()) } diff --git a/storagegroup/test/generate.go b/storagegroup/test/generate.go index 181dc8c..b8bffaa 100644 --- a/storagegroup/test/generate.go +++ b/storagegroup/test/generate.go @@ -3,7 +3,7 @@ package storagegrouptest import ( checksumtest "github.com/nspcc-dev/neofs-sdk-go/checksum/test" oid "github.com/nspcc-dev/neofs-sdk-go/object/id" - "github.com/nspcc-dev/neofs-sdk-go/object/id/test" + oidtest "github.com/nspcc-dev/neofs-sdk-go/object/id/test" "github.com/nspcc-dev/neofs-sdk-go/storagegroup" ) @@ -14,7 +14,7 @@ func StorageGroup() *storagegroup.StorageGroup { x.SetExpirationEpoch(66) x.SetValidationDataSize(322) x.SetValidationDataHash(checksumtest.Checksum()) - x.SetMembers([]*oid.ID{test.ID(), test.ID()}) + x.SetMembers([]*oid.ID{oidtest.ID(), oidtest.ID()}) return x }