MCPcopy
hub / github.com/minio/minio-go / TestAllVersionsExpiration

Function TestAllVersionsExpiration

pkg/lifecycle/lifecycle_test.go:485–507  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

483}
484
485func TestAllVersionsExpiration(t *testing.T) {
486 expected := []byte(`{"Rules":[{"AllVersionsExpiration":{"Days":2,"DeleteMarker":true},"ID":"all-versions-expiration","Status":"Enabled"}]}`)
487 lc := Configuration{
488 Rules: []Rule{
489 {
490 AllVersionsExpiration: AllVersionsExpiration{
491 Days: 2,
492 DeleteMarker: ExpireDeleteMarker(true),
493 },
494 ID: "all-versions-expiration",
495 Status: "Enabled",
496 },
497 },
498 }
499
500 got, err := json.Marshal(lc)
501 if err != nil {
502 t.Fatalf("Failed to marshal due to %v", err)
503 }
504 if !bytes.Equal(expected, got) {
505 t.Fatalf("Expected %s but got %s", expected, got)
506 }
507}

Callers

nothing calls this directly

Calls 3

ExpireDeleteMarkerTypeAlias · 0.85
EqualMethod · 0.80
MarshalMethod · 0.65

Tested by

no test coverage detected