MCPcopy Index your code
hub / github.com/go-task/task / TestBuildHTTPClient_CACertInvalid

Function TestBuildHTTPClient_CACertInvalid

taskfile/node_http_test.go:119–132  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

117}
118
119func TestBuildHTTPClient_CACertInvalid(t *testing.T) {
120 t.Parallel()
121
122 // Create a temporary file with invalid content
123 tempDir := t.TempDir()
124 caCertPath := filepath.Join(tempDir, "invalid.crt")
125 err := os.WriteFile(caCertPath, []byte("not a valid certificate"), 0o600)
126 require.NoError(t, err)
127
128 client, err := buildHTTPClient(false, caCertPath, "", "")
129 assert.Error(t, err)
130 assert.Nil(t, client)
131 assert.Contains(t, err.Error(), "failed to parse CA certificate")
132}
133
134func TestBuildHTTPClient_CertWithoutKey(t *testing.T) {
135 t.Parallel()

Callers

nothing calls this directly

Calls 2

buildHTTPClientFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…