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

Function TestNewEvent

pkg/session/session_test.go:9–36  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

7)
8
9func TestNewEvent(t *testing.T) {
10 invocationID := "test-invocation"
11 event := NewEvent(invocationID)
12
13 if event == nil {
14 t.Fatal("expected Event, got nil")
15 }
16
17 if event.InvocationID != invocationID {
18 t.Errorf("expected InvocationID '%s', got '%s'", invocationID, event.InvocationID)
19 }
20
21 if event.ID == "" {
22 t.Error("expected event ID to be generated")
23 }
24
25 if event.Actions.StateDelta == nil {
26 t.Error("expected StateDelta to be initialized")
27 }
28
29 if event.Actions.ArtifactDelta == nil {
30 t.Error("expected ArtifactDelta to be initialized")
31 }
32
33 if event.Metadata == nil {
34 t.Error("expected Metadata to be initialized")
35 }
36}
37
38func TestEvent_IsFinalResponse_WithSkipSummarization(t *testing.T) {
39 event := &Event{

Callers

nothing calls this directly

Calls 2

NewEventFunction · 0.85
ErrorMethod · 0.65

Tested by

no test coverage detected