[#634] Fix tests

Signed-off-by: Angira Kekteeva <kira@nspcc.ru>
This commit is contained in:
Angira Kekteeva 2022-08-16 12:19:56 +04:00 committed by Kirillov Denis
parent ce543e910c
commit 3b343d1bd5

View file

@ -18,22 +18,24 @@ func TestObjectLockAttributes(t *testing.T) {
obj := tc.putObject([]byte("content obj1 v1")) obj := tc.putObject([]byte("content obj1 v1"))
p := &ObjectVersion{ p := &PutLockInfoParams{
BktInfo: tc.bktInfo, ObjVersion: &ObjectVersion{
ObjectName: obj.Name, BktInfo: tc.bktInfo,
VersionID: obj.VersionID(), ObjectName: obj.Name,
} VersionID: obj.VersionID(),
lock := &data.ObjectLock{
Retention: &data.RetentionLock{
Until: time.Now(),
}, },
NewLock: &data.ObjectLock{
Retention: &data.RetentionLock{
Until: time.Now(),
},
},
CopiesNumber: 0,
} }
err = tc.layer.PutLockInfo(tc.ctx, p, lock) err = tc.layer.PutLockInfo(tc.ctx, p)
require.NoError(t, err) require.NoError(t, err)
foundLock, err := tc.layer.GetLockInfo(tc.ctx, p) foundLock, err := tc.layer.GetLockInfo(tc.ctx, p.ObjVersion)
require.NoError(t, err) require.NoError(t, err)
lockObj := tc.getObjectByID(foundLock.Retention()) lockObj := tc.getObjectByID(foundLock.Retention())