MCPcopy Create free account
hub / github.com/docker/cli / TestCompleteContextNames

Function TestCompleteContextNames

cmd/docker/completions_test.go:32–43  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

30}
31
32func TestCompleteContextNames(t *testing.T) {
33 expectedNames := []string{"context-b", "context-c", "context-a"}
34 cli := &fakeCLI{
35 contextStore: fakeContextStore{
36 names: expectedNames,
37 },
38 }
39
40 values, directives := completeContextNames(cli)(nil, nil, "")
41 assert.Check(t, is.Equal(directives, cobra.ShellCompDirectiveNoFileComp))
42 assert.Check(t, is.DeepEqual(values, expectedNames))
43}
44
45func TestCompleteLogLevels(t *testing.T) {
46 values, directives := completeLogLevels(nil, nil, "")

Callers

nothing calls this directly

Calls 1

completeContextNamesFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…