MCPcopy Create free account
hub / github.com/conforma/cli / TestInEffectDays

Function TestInEffectDays

internal/tracker/tracker_test.go:725–749  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

723}
724
725func TestInEffectDays(t *testing.T) {
726 ctx := context.WithValue(context.Background(), image.RemoteHead, head)
727
728 client := fakeClient{objects: testObjects, images: testImages}
729 ctx = WithClient(ctx, client)
730
731 // Test that inEffectDays parameter is now used for expires_on calculation
732 inEffectDays := 666
733
734 urls := []string{
735 "registry.com/mixed:1.0@" + sampleHashOne.String(),
736 }
737
738 // Expected: inEffectDays is used for expiration, new records have no expiration
739 expected := hd.Doc(`
740 ---
741 trusted_tasks:
742 oci://registry.com/mixed:1.0:
743 - ref: ` + sampleHashOne.String() + `
744 `)
745
746 output, err := Track(ctx, urls, nil, true, false, inEffectDays)
747 require.NoError(t, err)
748 require.Equal(t, expected, string(output))
749}
750
751func TestSetExpiration(t *testing.T) {
752 tests := []struct {

Callers

nothing calls this directly

Calls 3

TrackFunction · 0.85
WithClientFunction · 0.70
StringMethod · 0.45

Tested by

no test coverage detected