MCPcopy Create free account
hub / github.com/astercloud/aster / TestLogicMemoryMiddleware_Tools

Function TestLogicMemoryMiddleware_Tools

pkg/middleware/logic_memory_test.go:356–376  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

354}
355
356func TestLogicMemoryMiddleware_Tools(t *testing.T) {
357 store := logic.NewInMemoryStore()
358 manager, err := logic.NewManager(&logic.ManagerConfig{Store: store})
359 require.NoError(t, err)
360
361 mw, err := NewLogicMemoryMiddleware(&LogicMemoryMiddlewareConfig{
362 Manager: manager,
363 })
364 require.NoError(t, err)
365
366 tools := mw.Tools()
367 assert.Len(t, tools, 2)
368
369 // 验证工具名称
370 toolNames := make([]string, len(tools))
371 for i, tool := range tools {
372 toolNames[i] = tool.Name()
373 }
374 assert.Contains(t, toolNames, "logic_memory_query")
375 assert.Contains(t, toolNames, "logic_memory_update")
376}
377
378func TestLogicMemoryMiddleware_GetConfig(t *testing.T) {
379 store := logic.NewInMemoryStore()

Callers

nothing calls this directly

Calls 6

ToolsMethod · 0.95
NewInMemoryStoreFunction · 0.92
NewManagerFunction · 0.92
NewLogicMemoryMiddlewareFunction · 0.85
LenMethod · 0.65
NameMethod · 0.65

Tested by

no test coverage detected