MCPcopy Create free account
hub / github.com/diillson/chatcli / TestKnowledgeAdapter_SessionScoping

Function TestKnowledgeAdapter_SessionScoping

cli/knowledge_adapter_test.go:118–134  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

116}
117
118func TestKnowledgeAdapter_SessionScoping(t *testing.T) {
119 cli := newKnowledgeTestCLI(t)
120 cli.currentSessionName = "another-session"
121 a := &knowledgePluginAdapter{cli: cli}
122
123 if _, err := a.Search("anything", "", 0); err == nil {
124 t.Error("session without attached bases must get an actionable error")
125 }
126 if cli.knowledgeAgentBlock() != "" {
127 t.Error("agent block must be empty for sessions without knowledge bases")
128 }
129
130 out, err := a.List()
131 if err != nil || !strings.Contains(out, "No knowledge base attached") {
132 t.Errorf("List = %q, err %v", out, err)
133 }
134}

Callers

nothing calls this directly

Calls 6

SearchMethod · 0.95
ListMethod · 0.95
newKnowledgeTestCLIFunction · 0.85
knowledgeAgentBlockMethod · 0.80
ErrorfMethod · 0.80
ErrorMethod · 0.65

Tested by

no test coverage detected