[#569] Fix tests

Signed-off-by: Angira Kekteeva <kira@nspcc.ru>
This commit is contained in:
Angira Kekteeva 2022-07-19 19:45:08 +04:00 committed by Alex Vanin
parent 72013e08ec
commit 77f466b1d5
5 changed files with 8 additions and 8 deletions

View file

@ -153,7 +153,7 @@ func TestSettingsCacheType(t *testing.T) {
cache := NewSystemCache(DefaultSystemConfig(logger))
key := "key"
settings := &data.BucketSettings{VersioningEnabled: true}
settings := &data.BucketSettings{Versioning: data.VerEnabled}
err := cache.PutSettings(key, settings)
require.NoError(t, err)

View file

@ -109,7 +109,7 @@ func createTestBucketWithLock(ctx context.Context, t *testing.T, h *handlerConte
sp := &layer.PutSettingsParams{
BktInfo: bktInfo,
Settings: &data.BucketSettings{
VersioningEnabled: true,
Versioning: data.VerEnabled,
LockConfiguration: conf,
},
}

View file

@ -324,7 +324,7 @@ func TestPutBucketLockConfigurationHandler(t *testing.T) {
bktSettings, err := hc.Layer().GetBucketSettings(ctx, bktInfo)
require.NoError(t, err)
actualConf := bktSettings.LockConfiguration
require.True(t, bktSettings.VersioningEnabled)
require.True(t, bktSettings.VersioningEnabled())
require.Equal(t, tc.configuration.ObjectLockEnabled, actualConf.ObjectLockEnabled)
require.Equal(t, tc.configuration.Rule, actualConf.Rule)
})

View file

@ -12,7 +12,7 @@ func TestObjectLockAttributes(t *testing.T) {
tc := prepareContext(t)
err := tc.layer.PutBucketSettings(tc.ctx, &PutSettingsParams{
BktInfo: tc.bktInfo,
Settings: &data.BucketSettings{VersioningEnabled: true},
Settings: &data.BucketSettings{Versioning: data.VerEnabled},
})
require.NoError(t, err)

View file

@ -183,7 +183,7 @@ func TestSimpleVersioning(t *testing.T) {
tc := prepareContext(t)
err := tc.layer.PutBucketSettings(tc.ctx, &PutSettingsParams{
BktInfo: tc.bktInfo,
Settings: &data.BucketSettings{VersioningEnabled: true},
Settings: &data.BucketSettings{Versioning: data.VerEnabled},
})
require.NoError(t, err)
@ -220,7 +220,7 @@ func TestSimpleNoVersioning(t *testing.T) {
func TestVersioningDeleteObject(t *testing.T) {
tc := prepareContext(t)
settings := &data.BucketSettings{VersioningEnabled: true}
settings := &data.BucketSettings{Versioning: data.VerEnabled}
err := tc.layer.PutBucketSettings(tc.ctx, &PutSettingsParams{
BktInfo: tc.bktInfo,
Settings: settings,
@ -242,7 +242,7 @@ func TestGetUnversioned(t *testing.T) {
objContent := []byte("content obj1 v1")
objInfo := tc.putObject(objContent)
settings := &data.BucketSettings{VersioningEnabled: false}
settings := &data.BucketSettings{Versioning: data.VerUnversioned}
err := tc.layer.PutBucketSettings(tc.ctx, &PutSettingsParams{
BktInfo: tc.bktInfo,
Settings: settings,
@ -256,7 +256,7 @@ func TestGetUnversioned(t *testing.T) {
func TestVersioningDeleteSpecificObjectVersion(t *testing.T) {
tc := prepareContext(t)
settings := &data.BucketSettings{VersioningEnabled: true}
settings := &data.BucketSettings{Versioning: data.VerEnabled}
err := tc.layer.PutBucketSettings(tc.ctx, &PutSettingsParams{
BktInfo: tc.bktInfo,
Settings: settings,