Skip to content

Commit

Permalink
test: remove unnecessary tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelbrm committed May 28, 2024
1 parent 041a8d2 commit 65718ec
Showing 1 changed file with 0 additions and 43 deletions.
43 changes: 0 additions & 43 deletions model/issuer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,49 +390,6 @@ func TestIssuer_findActiveKeys(t *testing.T) {
}
}

func TestIssuer_findActiveKeysEV(t *testing.T) {
issuer := &Issuer{
Version: 3,
Keys: []IssuerKeys{
{
SigningKey: []byte(`key_a`),
StartAt: ptrTo(time.Date(2024, time.May, 23, 0, 0, 0, 0, time.UTC)),
EndAt: ptrTo(time.Date(2024, time.May, 24, 0, 0, 0, 0, time.UTC)),
},

{
SigningKey: []byte(`key_b`),
StartAt: ptrTo(time.Date(2024, time.May, 24, 0, 0, 0, 0, time.UTC)),
EndAt: ptrTo(time.Date(2024, time.May, 25, 0, 0, 0, 0, time.UTC)),
},

{
SigningKey: []byte(`key_c`),
StartAt: ptrTo(time.Date(2024, time.May, 25, 0, 0, 0, 0, time.UTC)),
EndAt: ptrTo(time.Date(2024, time.May, 26, 0, 0, 0, 0, time.UTC)),
},
},
}

t.Run("strict_b_leeway_a", func(t *testing.T) {
now := time.Date(2024, time.May, 24, 0, 52, 25, 0, time.UTC)

actual, err := issuer.findActiveKeys(now, 1*time.Hour)
must.Equal(t, nil, err)

should.Equal(t, []*IssuerKeys{&issuer.Keys[1], &issuer.Keys[0]}, actual)
})

t.Run("strict_b_leeway_c", func(t *testing.T) {
now := time.Date(2024, time.May, 24, 23, 52, 25, 0, time.UTC)

actual, err := issuer.findActiveKeys(now, 1*time.Hour)
must.Equal(t, nil, err)

should.Equal(t, []*IssuerKeys{&issuer.Keys[1], &issuer.Keys[2]}, actual)
})
}

func ptrTo[T any](v T) *T {
return &v
}
Expand Down

0 comments on commit 65718ec

Please sign in to comment.