MCPcopy Index your code
hub / github.com/coder/coder / TestAdvisorToolRejectsEmptyQuestion

Function TestAdvisorToolRejectsEmptyQuestion

coderd/x/chatd/chatadvisor/tool_test.go:182–195  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

180}
181
182func TestAdvisorToolRejectsEmptyQuestion(t *testing.T) {
183 t.Parallel()
184
185 tool := chatadvisor.Tool(chatadvisor.ToolOptions{
186 Runtime: mustAdvisorRuntime(t),
187 GetConversationSnapshot: func() []fantasy.Message {
188 return nil
189 },
190 })
191
192 resp := runAdvisorTool(t, tool, chatadvisor.AdvisorArgs{Question: " \t\n "})
193 require.True(t, resp.IsError)
194 require.Contains(t, resp.Content, "question is required")
195}
196
197func TestAdvisorToolPassesNormalQuestion(t *testing.T) {
198 t.Parallel()

Callers

nothing calls this directly

Calls 4

ToolFunction · 0.92
mustAdvisorRuntimeFunction · 0.85
runAdvisorToolFunction · 0.85
ContainsMethod · 0.45

Tested by

no test coverage detected