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

Function TestEffectiveTimeNowNoMutation

internal/policy/policy_test.go:694–711  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

692}
693
694func TestEffectiveTimeNowNoMutation(t *testing.T) {
695 then := now
696 t.Cleanup(func() {
697 now = then
698 })
699
700 epoch := time.Unix(0, 0).UTC()
701 now = func() time.Time { return epoch }
702
703 p, err := NewOfflinePolicy(context.Background(), Now)
704 assert.NoError(t, err)
705
706 assert.Equal(t, epoch, p.EffectiveTime())
707
708 p.AttestationTime(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC))
709
710 assert.Equal(t, epoch, p.EffectiveTime())
711}
712
713func TestEffectiveTimeGivenNoMutation(t *testing.T) {
714 epoch := time.Unix(0, 0).UTC()

Callers

nothing calls this directly

Calls 4

NewOfflinePolicyFunction · 0.85
CleanupMethod · 0.80
EffectiveTimeMethod · 0.65
AttestationTimeMethod · 0.65

Tested by

no test coverage detected