From 2a6a0d2997cea59c23fca2685eaf8c6164cce2e8 Mon Sep 17 00:00:00 2001 From: Joshua Casey Date: Mon, 19 Aug 2024 20:41:49 -0500 Subject: [PATCH] Refactor certauthority_test to not need pool.Subjects() --- internal/certauthority/certauthority_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/certauthority/certauthority_test.go b/internal/certauthority/certauthority_test.go index cd438f220..0128b1ad0 100644 --- a/internal/certauthority/certauthority_test.go +++ b/internal/certauthority/certauthority_test.go @@ -208,8 +208,10 @@ func TestPool(t *testing.T) { ca, err := New("test", 1*time.Hour) require.NoError(t, err) - pool := ca.Pool() - require.Len(t, pool.Subjects(), 1) + expectedPool := x509.NewCertPool() + expectedPool.AppendCertsFromPEM(ca.Bundle()) + + require.True(t, expectedPool.Equal(ca.Pool())) } type errSigner struct {