(t *testing.T)
| 723 | } |
| 724 | |
| 725 | func 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 | |
| 751 | func TestSetExpiration(t *testing.T) { |
| 752 | tests := []struct { |
nothing calls this directly
no test coverage detected