MCPcopy Create free account
hub / github.com/docker/docker-agent / TestSetIdentity

Function TestSetIdentity

pkg/useragent/useragent_test.go:13–22  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

11)
12
13func TestSetIdentity(t *testing.T) {
14 t.Parallel()
15 req, err := http.NewRequestWithContext(t.Context(), http.MethodGet, "http://example.com/", http.NoBody)
16 require.NoError(t, err)
17
18 SetIdentity(req)
19
20 assert.Equal(t, Header, req.Header.Get("User-Agent"))
21 assert.Equal(t, version.Version, req.Header.Get(HeaderAgentVersion))
22}

Callers

nothing calls this directly

Calls 3

SetIdentityFunction · 0.85
ContextMethod · 0.80
GetMethod · 0.65

Tested by

no test coverage detected