MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / patchKey

Method patchKey

internal/server/task3585_patch_key_test.go:20–26  ·  view source on GitHub ↗

TASK-3585: idempotency keys on patch.

(t *testing.T, key string, body map[string]any)

Source from the content-addressed store, hash-verified

18// TASK-3585: idempotency keys on patch.
19
20func (f *patchFixture) patchKey(t *testing.T, key string, body map[string]any) (int, map[string]any, http.Header) {
21 t.Helper()
22 rr := doRequestWithHeaders(f.srv, "POST", f.path+"/patch", body, map[string]string{"Idempotency-Key": key})
23 var out map[string]any
24 _ = json.Unmarshal(rr.Body.Bytes(), &out)
25 return rr.Code, out, rr.Header()
26}
27
28// An insert-shaped edit keeps its anchor, so a plain retry would insert it
29// twice. With a key, the retry replays the first answer.

Calls 3

doRequestWithHeadersFunction · 0.85
HelperMethod · 0.80
HeaderMethod · 0.45

Tested by

no test coverage detected