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

Function TestModelsListCommand_DefaultOutput

cmd/root/models_test.go:65–82  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

63}
64
65func TestModelsListCommand_DefaultOutput(t *testing.T) {
66 t.Parallel()
67
68 var buf bytes.Buffer
69 cmd := newModelsCmd(withTestConfig(map[string]string{"ANTHROPIC_API_KEY": "test-key"}))
70 cmd.SetOut(&buf)
71 cmd.SetErr(&buf)
72 cmd.SetArgs(nil)
73
74 require.NoError(t, cmd.Execute())
75
76 output := buf.String()
77 assert.Contains(t, output, "PROVIDER")
78 assert.Contains(t, output, "MODEL")
79 assert.Contains(t, output, "anthropic")
80 // A catalog-only model must appear, proving the injected store was read.
81 assert.Contains(t, output, catalogOnlyModel)
82}
83
84func TestModelsListCommand_ProviderFilter(t *testing.T) {
85 t.Parallel()

Callers

nothing calls this directly

Calls 4

StringMethod · 0.95
newModelsCmdFunction · 0.85
withTestConfigFunction · 0.85
ExecuteMethod · 0.45

Tested by

no test coverage detected