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

Function TestLogicMemoryMiddleware_GetConfig

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

Source from the content-addressed store, hash-verified

376}
377
378func TestLogicMemoryMiddleware_GetConfig(t *testing.T) {
379 store := logic.NewInMemoryStore()
380 manager, err := logic.NewManager(&logic.ManagerConfig{Store: store})
381 require.NoError(t, err)
382
383 mw, err := NewLogicMemoryMiddleware(&LogicMemoryMiddlewareConfig{
384 Manager: manager,
385 EnableCapture: true,
386 EnableInjection: true,
387 MaxMemories: 10,
388 MinConfidence: 0.7,
389 AsyncCapture: true,
390 InjectionPoint: "system_prompt_start",
391 })
392 require.NoError(t, err)
393
394 config := mw.GetConfig()
395 assert.Equal(t, true, config["enable_capture"])
396 assert.Equal(t, true, config["enable_injection"])
397 assert.Equal(t, 10, config["max_memories"])
398 assert.Equal(t, 0.7, config["min_confidence"])
399 assert.Equal(t, true, config["async_capture"])
400 assert.Equal(t, "system_prompt_start", config["injection_point"])
401}
402
403func TestDefaultNamespaceExtractor(t *testing.T) {
404 t.Run("extract from namespace", func(t *testing.T) {

Callers

nothing calls this directly

Calls 4

GetConfigMethod · 0.95
NewInMemoryStoreFunction · 0.92
NewManagerFunction · 0.92
NewLogicMemoryMiddlewareFunction · 0.85

Tested by

no test coverage detected