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

Function TestV2Commands_DisplayText

pkg/config/commands_test.go:41–53  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

39}
40
41func TestV2Commands_DisplayText(t *testing.T) {
42 t.Parallel()
43 cfg, err := Load(t.Context(), NewFileSource("testdata/commands_v2.yaml"))
44 require.NoError(t, err)
45
46 // Simple format: DisplayText returns the instruction
47 require.Equal(t, "root", cfg.Agents[0].Name)
48 require.Equal(t, "check disk", cfg.Agents[0].Commands["df"].DisplayText())
49
50 // Advanced format: DisplayText returns description if available
51 require.Equal(t, "advanced_agent", cfg.Agents[2].Name)
52 require.Equal(t, "Fix linting errors in the codebase", cfg.Agents[2].Commands["fix-lint"].DisplayText())
53}
54
55func TestMigrate_v1_Commands_AllForms(t *testing.T) {
56 t.Parallel()

Callers

nothing calls this directly

Calls 4

NewFileSourceFunction · 0.85
ContextMethod · 0.80
DisplayTextMethod · 0.80
LoadFunction · 0.70

Tested by

no test coverage detected