| 95 | } |
| 96 | |
| 97 | func 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 | |
| 118 | func TestKnowledgeAdapter_SessionScoping(t *testing.T) { |
| 119 | cli := newKnowledgeTestCLI(t) |