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

Function TestKnowledgeAdapter_WithoutManager

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

Source from the content-addressed store, hash-verified

95}
96
97func TestKnowledgeAdapter_WithoutManager(t *testing.T) {
98 cli := &ChatCLI{} // no contextHandler wired
99 a := &knowledgePluginAdapter{cli: cli}
100
101 if _, err := a.Search("x", "", 0); err == nil {
102 t.Error("Search without a manager must error")
103 }
104 if _, err := a.Get("x", "", 0); err == nil {
105 t.Error("Get without a manager must error")
106 }
107 if _, err := a.TOC("", ""); err == nil {
108 t.Error("TOC without a manager must error")
109 }
110 if _, err := a.List(); err == nil {
111 t.Error("List without a manager must error")
112 }
113 if cli.knowledgeAgentBlock() != "" {
114 t.Error("agent block without a manager must be empty")
115 }
116}
117
118func TestKnowledgeAdapter_SessionScoping(t *testing.T) {
119 cli := newKnowledgeTestCLI(t)

Callers

nothing calls this directly

Calls 6

SearchMethod · 0.95
GetMethod · 0.95
TOCMethod · 0.95
ListMethod · 0.95
knowledgeAgentBlockMethod · 0.95
ErrorMethod · 0.65

Tested by

no test coverage detected