MCPcopy Index your code
hub / github.com/docker/cli / TestNewAPIClientFromFlagsWithAPIVersionFromEnv

Function TestNewAPIClientFromFlagsWithAPIVersionFromEnv

cli/command/cli_test.go:122–133  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

120}
121
122func TestNewAPIClientFromFlagsWithAPIVersionFromEnv(t *testing.T) {
123 const customVersion = "v3.3"
124 const expectedVersion = "3.3"
125 t.Setenv("DOCKER_API_VERSION", customVersion)
126 t.Setenv("DOCKER_HOST", ":2375")
127
128 opts := &flags.ClientOptions{}
129 configFile := &configfile.ConfigFile{}
130 apiclient, err := NewAPIClientFromFlags(opts, configFile)
131 assert.NilError(t, err)
132 assert.Equal(t, apiclient.ClientVersion(), expectedVersion)
133}
134
135type fakeClient struct {
136 client.Client

Callers

nothing calls this directly

Calls 2

NewAPIClientFromFlagsFunction · 0.85
ClientVersionMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…