MCPcopy Index your code
hub / github.com/InferCore/InferCore / TestMemoryStore_CreateGet

Function TestMemoryStore_CreateGet

internal/requests/memory_test.go:9–33  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

7)
8
9func TestMemoryStore_CreateGet(t *testing.T) {
10 st := NewMemoryStore()
11 ctx := context.Background()
12 row := RequestRow{
13 RequestID: "r1",
14 TenantID: "t",
15 TaskType: "chat",
16 Priority: "p",
17 CreatedAt: time.Now(),
18 UpdatedAt: time.Now(),
19 }
20 if err := st.CreateRequest(ctx, row); err != nil {
21 t.Fatal(err)
22 }
23 got, err := st.GetRequest(ctx, "r1")
24 if err != nil {
25 t.Fatal(err)
26 }
27 if got.RequestID != "r1" || got.TenantID != "t" {
28 t.Fatalf("%+v", got)
29 }
30 if err := st.CreateRequest(ctx, row); err == nil {
31 t.Fatal("expected duplicate error")
32 }
33}
34
35func TestMemoryStore_GetRequest_NotFound(t *testing.T) {
36 st := NewMemoryStore()

Callers

nothing calls this directly

Calls 3

NewMemoryStoreFunction · 0.85
CreateRequestMethod · 0.65
GetRequestMethod · 0.65

Tested by

no test coverage detected