MCPcopy Create free account
hub / github.com/InferCore/InferCore / TestReplay_UnknownMode

Function TestReplay_UnknownMode

internal/replay/replay_test.go:27–50  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

25}
26
27func TestReplay_UnknownMode(t *testing.T) {
28 st := requests.NewMemoryStore()
29 req := types.AIRequest{
30 TenantID: "t",
31 TaskType: "chat",
32 Priority: "p",
33 Input: map[string]any{"text": "hi"},
34 Options: types.RequestOptions{Stream: false, MaxTokens: 64},
35 }
36 full, _ := json.Marshal(req)
37 _ = st.CreateRequest(context.Background(), requests.RequestRow{
38 RequestID: "rid1",
39 TenantID: "t",
40 TaskType: "chat",
41 Priority: "p",
42 AIRequestJSON: full,
43 CreatedAt: time.Now(),
44 UpdatedAt: time.Now(),
45 })
46 _, err := Replay(context.Background(), &config.Config{}, st, "rid1", Mode("bogus"), Dependencies{})
47 if err == nil || !strings.Contains(err.Error(), "unknown replay mode") {
48 t.Fatalf("err=%v", err)
49 }
50}
51
52func TestReplayExact_MissingPrimaryBackend(t *testing.T) {
53 st := requests.NewMemoryStore()

Callers

nothing calls this directly

Calls 5

NewMemoryStoreFunction · 0.92
ReplayFunction · 0.85
ModeTypeAlias · 0.85
CreateRequestMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected