(t *testing.T)
| 89 | } |
| 90 | |
| 91 | func TestNewClient(t *testing.T) { |
| 92 | t.Parallel() |
| 93 | logger := slog.New(slog.NewTextHandler(os.Stderr, nil)) |
| 94 | |
| 95 | // Note: debug mode does NOT disable HTTP calls - it only adds extra logging |
| 96 | client := newClient(t.Context(), logger, false, false, "test-version") |
| 97 | |
| 98 | // This should not panic |
| 99 | commandEvent := &CommandEvent{ |
| 100 | Action: "test-command", |
| 101 | Success: true, |
| 102 | Error: "", |
| 103 | } |
| 104 | client.Track(t.Context(), commandEvent) |
| 105 | client.RecordToolCall(t.Context(), "test-tool", "session-id", "agent-name", time.Millisecond, nil) |
| 106 | client.RecordTokenUsage(t.Context(), "test-model", 100, 50, 0.5) |
| 107 | } |
| 108 | |
| 109 | func TestSessionTracking(t *testing.T) { |
| 110 | t.Parallel() |
nothing calls this directly
no test coverage detected