Files
kopia/internal/blobtesting/object_locking_map_test.go
Shikhar Mall 3f4dab2202 versioned map mock storage for blob-retention unit-testing (#1590)
* versioned map mock storage

* Update internal/blobtesting/versionedmap.go

Co-authored-by: Julio Lopez <julio+gh@kasten.io>

* versionedMapStorage -> objectLockingMap

* move out write checks in a dedicated method

Co-authored-by: Shikhar Mall <shikhar@kasten.io>
Co-authored-by: Julio Lopez <julio+gh@kasten.io>
2021-12-17 13:26:34 -08:00

24 lines
456 B
Go

package blobtesting
import (
"testing"
"time"
"github.com/minio/minio-go/v7"
"github.com/kopia/kopia/internal/testlogging"
"github.com/kopia/kopia/repo/blob"
)
func TestObjectLockingStorage(t *testing.T) {
r := NewVersionedMapStorage(nil)
if r == nil {
t.Errorf("unexpected result: %v", r)
}
VerifyStorage(testlogging.Context(t), t, r, blob.PutOptions{
RetentionMode: minio.Governance.String(),
RetentionPeriod: 24 * time.Hour,
})
}