mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-05-07 08:57:12 +00:00
39 lines
970 B
Go
39 lines
970 B
Go
package chat
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/rcourtman/pulse-go-rewrite/internal/ai/tools"
|
|
)
|
|
|
|
func TestServiceSettersAndAutonomousMode(t *testing.T) {
|
|
executor := tools.NewPulseToolExecutor(tools.ExecutorConfig{})
|
|
loop := &AgenticLoop{}
|
|
service := &Service{
|
|
executor: executor,
|
|
agenticLoop: loop,
|
|
}
|
|
|
|
service.SetIncidentRecorderProvider(nil)
|
|
service.SetEventCorrelatorProvider(nil)
|
|
service.SetKnowledgeStoreProvider(nil)
|
|
|
|
service.SetAutonomousMode(true)
|
|
if !service.autonomousMode {
|
|
t.Fatalf("expected autonomousMode true")
|
|
}
|
|
if !loop.autonomousMode {
|
|
t.Fatalf("expected agentic loop to be autonomous")
|
|
}
|
|
}
|
|
|
|
func TestServiceExecuteCommand_NoExecutor(t *testing.T) {
|
|
service := &Service{}
|
|
_, _, err := service.ExecuteCommand(context.Background(), "ls", "")
|
|
if err == nil {
|
|
t.Fatalf("expected error when executor is unavailable")
|
|
}
|
|
}
|
|
|
|
// TestPatrolServiceSessionLifecycle was removed: it tested the deleted chat/patrol.go bridge.
|