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

Function TestAgentStatus

pkg/agent/agent_test.go:47–81  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

45}
46
47func TestAgentStatus(t *testing.T) {
48 deps := setupTestDeps(t)
49
50 config := &types.AgentConfig{
51 TemplateID: "test-template",
52 ModelConfig: &types.ModelConfig{
53 Provider: "anthropic",
54 Model: "claude-sonnet-4-5",
55 APIKey: "test-key",
56 },
57 Sandbox: &types.SandboxConfig{
58 Kind: types.SandboxKindMock,
59 WorkDir: "/tmp/test",
60 },
61 }
62
63 ag, err := Create(context.Background(), config, deps)
64 if err != nil {
65 t.Fatalf("Failed to create agent: %v", err)
66 }
67 defer func() { _ = ag.Close() }()
68
69 status := ag.Status()
70 if status == nil {
71 t.Fatal("Status should not be nil")
72 }
73
74 if status.AgentID != ag.ID() {
75 t.Errorf("Expected AgentID %s, got %s", ag.ID(), status.AgentID)
76 }
77
78 if status.State != types.AgentStateReady {
79 t.Errorf("Expected state Ready, got %s", status.State)
80 }
81}
82
83func TestAgentEventBus(t *testing.T) {
84 deps := setupTestDeps(t)

Callers

nothing calls this directly

Calls 5

setupTestDepsFunction · 0.85
CreateFunction · 0.85
CloseMethod · 0.65
IDMethod · 0.65
StatusMethod · 0.45

Tested by

no test coverage detected