From dc77ad48633379300a2fac4826a5618ec918494f Mon Sep 17 00:00:00 2001 From: Angira Kekteeva Date: Fri, 5 Aug 2022 05:41:33 +0400 Subject: [PATCH] [#577] Fix tests Signed-off-by: Angira Kekteeva --- api/handler/delete_test.go | 3 +-- api/handler/object_list_test.go | 4 ++-- api/layer/versioning_test.go | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/api/handler/delete_test.go b/api/handler/delete_test.go index b201064..022aeae 100644 --- a/api/handler/delete_test.go +++ b/api/handler/delete_test.go @@ -8,7 +8,6 @@ import ( "github.com/nspcc-dev/neofs-s3-gw/api" "github.com/nspcc-dev/neofs-s3-gw/api/data" - "github.com/nspcc-dev/neofs-s3-gw/api/layer" "github.com/stretchr/testify/require" ) @@ -54,7 +53,7 @@ func TestDeleteObjectFromSuspended(t *testing.T) { versionID, isDeleteMarker := deleteObject(t, tc, bktName, objName, emptyVersion) require.True(t, isDeleteMarker) - require.Equal(t, layer.UnversionedObjectVersionID, versionID) + require.Equal(t, data.UnversionedObjectVersionID, versionID) } func TestDeleteDeletedObject(t *testing.T) { diff --git a/api/handler/object_list_test.go b/api/handler/object_list_test.go index 33ba452..830ca0b 100644 --- a/api/handler/object_list_test.go +++ b/api/handler/object_list_test.go @@ -8,7 +8,7 @@ import ( "strconv" "testing" - "github.com/nspcc-dev/neofs-s3-gw/api/layer" + "github.com/nspcc-dev/neofs-s3-gw/api/data" "github.com/stretchr/testify/require" ) @@ -73,7 +73,7 @@ func TestListObjectNullVersions(t *testing.T) { parseTestResponse(t, w, result) require.Len(t, result.Version, 2) - require.Equal(t, layer.UnversionedObjectVersionID, result.Version[1].VersionID) + require.Equal(t, data.UnversionedObjectVersionID, result.Version[1].VersionID) } func TestS3CompatibilityBucketListV2BothContinuationTokenStartAfter(t *testing.T) { diff --git a/api/layer/versioning_test.go b/api/layer/versioning_test.go index d8e5281..b8958be 100644 --- a/api/layer/versioning_test.go +++ b/api/layer/versioning_test.go @@ -249,7 +249,7 @@ func TestGetUnversioned(t *testing.T) { }) require.NoError(t, err) - resInfo, buffer := tc.getObject(tc.obj, UnversionedObjectVersionID, false) + resInfo, buffer := tc.getObject(tc.obj, data.UnversionedObjectVersionID, false) require.Equal(t, objContent, buffer) require.Equal(t, objInfo.VersionID(), resInfo.VersionID()) } @@ -280,7 +280,7 @@ func TestVersioningDeleteSpecificObjectVersion(t *testing.T) { versions := tc.listVersions() for _, ver := range versions.DeleteMarker { if ver.IsLatest { - tc.deleteObject(tc.obj, ver.Object.Version(), settings) + tc.deleteObject(tc.obj, ver.ObjectInfo.VersionID(), settings) } }