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

Function TestContextAdapter_Validation

cli/context_adapter_test.go:153–169  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

151}
152
153func TestContextAdapter_Validation(t *testing.T) {
154 cli, corpus := newContextTestCLI(t)
155 a := &contextPluginAdapter{cli: cli}
156
157 if _, err := a.Create("bad", "bogus-mode", []string{corpus}, "", false); err == nil {
158 t.Error("invalid mode must error")
159 }
160 if _, err := a.Attach("nonexistent", 0, 0); err == nil {
161 t.Error("attaching a missing context must error")
162 }
163 if _, err := a.Detach("nonexistent"); err == nil {
164 t.Error("detaching a missing context must error")
165 }
166 if _, err := a.Delete("nonexistent"); err == nil {
167 t.Error("deleting a missing context must error")
168 }
169}
170
171func TestContextAdapter_WithoutManager(t *testing.T) {
172 a := &contextPluginAdapter{cli: &ChatCLI{}}

Callers

nothing calls this directly

Calls 6

CreateMethod · 0.95
AttachMethod · 0.95
DetachMethod · 0.95
DeleteMethod · 0.95
newContextTestCLIFunction · 0.85
ErrorMethod · 0.65

Tested by

no test coverage detected