MCPcopy Create free account
hub / github.com/compozy/agh / TestBundlesRenderHumanAndToon

Function TestBundlesRenderHumanAndToon

internal/cli/render_test.go:13–113  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

11)
12
13func TestBundlesRenderHumanAndToon(t *testing.T) {
14 t.Parallel()
15
16 sessionInfo := SessionRecord{
17 ID: "sess-1",
18 Name: "demo",
19 AgentName: "coder",
20 WorkspaceID: "ws-1",
21 WorkspacePath: "/workspace/project",
22 State: "active",
23 ACPSessionID: "acp-1",
24 ACPCaps: &ACPCapsRecord{
25 SupportsLoadSession: true,
26 SupportedModes: []string{"chat"},
27 },
28 CreatedAt: fixedTestNow.Add(-10 * time.Minute),
29 UpdatedAt: fixedTestNow,
30 }
31 sessionEvents := []SessionEventRecord{{
32 ID: "evt-1",
33 SessionID: "sess-1",
34 Sequence: 1,
35 TurnID: "turn-1",
36 Type: "agent_message",
37 AgentName: "coder",
38 Content: mustJSON(t, map[string]string{"text": "hello"}),
39 Timestamp: fixedTestNow,
40 }}
41 history := []TurnHistoryRecord{{TurnID: "turn-1", Events: sessionEvents}}
42 agentEvents := []AgentEventRecord{{
43 Type: "agent_message",
44 Timestamp: fixedTestNow,
45 Text: "hello",
46 }}
47 listLogs := []LogEventRecord{{
48 ID: "sum-1",
49 SessionID: "sess-1",
50 Type: "done",
51 AgentName: "coder",
52 Summary: "finished",
53 Timestamp: fixedTestNow,
54 }}
55
56 bundles := []struct {
57 name string
58 bundle outputBundle
59 }{
60 {
61 name: "agent",
62 bundle: agentBundle(
63 AgentRecord{Name: "coder", Provider: "fake", Prompt: "You are coder.", Tools: []string{"shell"}},
64 ),
65 },
66 {name: "session", bundle: sessionBundle(sessionInfo, func() time.Time { return fixedTestNow })},
67 {name: "sessionEvents", bundle: sessionEventsBundle(sessionEvents)},
68 {name: "sessionHistory", bundle: sessionHistoryBundle(history)},
69 {name: "agentEvents", bundle: agentEventsBundle(agentEvents)},
70 {name: "listLogs", bundle: logsBundle(listLogs)},

Callers

nothing calls this directly

Calls 11

agentBundleFunction · 0.85
sessionBundleFunction · 0.85
sessionEventsBundleFunction · 0.85
sessionHistoryBundleFunction · 0.85
agentEventsBundleFunction · 0.85
logsBundleFunction · 0.85
daemonStatusBundleFunction · 0.85
whoamiBundleFunction · 0.85
mustJSONFunction · 0.70
RunMethod · 0.65
AddMethod · 0.45

Tested by

no test coverage detected