(t *testing.T)
| 116 | } |
| 117 | |
| 118 | func 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 | } |
nothing calls this directly
no test coverage detected