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

Function TestExpiredObjectDeleteMarker

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

Source from the content-addressed store, hash-verified

460}
461
462func TestExpiredObjectDeleteMarker(t *testing.T) {
463 expected := []byte(`{"Rules":[{"Expiration":{"ExpiredObjectDeleteMarker":true},"ID":"expired-object-delete-marker","Status":"Enabled"}]}`)
464 lc := Configuration{
465 Rules: []Rule{
466 {
467 Expiration: Expiration{
468 DeleteMarker: true,
469 },
470 ID: "expired-object-delete-marker",
471 Status: "Enabled",
472 },
473 },
474 }
475
476 got, err := json.Marshal(lc)
477 if err != nil {
478 t.Fatalf("Failed to marshal due to %v", err)
479 }
480 if !bytes.Equal(expected, got) {
481 t.Fatalf("Expected %s but got %s", expected, got)
482 }
483}
484
485func TestAllVersionsExpiration(t *testing.T) {
486 expected := []byte(`{"Rules":[{"AllVersionsExpiration":{"Days":2,"DeleteMarker":true},"ID":"all-versions-expiration","Status":"Enabled"}]}`)

Callers

nothing calls this directly

Calls 2

EqualMethod · 0.80
MarshalMethod · 0.65

Tested by

no test coverage detected