MCPcopy Create free account
hub / github.com/openclaw/gogcli / mockSlidesBatchUpdateServer

Function mockSlidesBatchUpdateServer

internal/cmd/slides_insert_text_test.go:20–39  ·  view source on GitHub ↗

mockSlidesBatchUpdateServer spins up an httptest.Server that captures the batchUpdate request body and returns a canned BatchUpdatePresentationResponse. Tests can inspect captured requests via the returned pointer.

(
	t *testing.T,
	captured *[]*slides.Request,
	response map[string]any,
)

Source from the content-addressed store, hash-verified

18// batchUpdate request body and returns a canned BatchUpdatePresentationResponse.
19// Tests can inspect captured requests via the returned pointer.
20func mockSlidesBatchUpdateServer(
21 t *testing.T,
22 captured *[]*slides.Request,
23 response map[string]any,
24) *httptest.Server {
25 t.Helper()
26 srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
27 w.Header().Set("Content-Type", "application/json")
28 if strings.HasSuffix(r.URL.Path, ":batchUpdate") && r.Method == http.MethodPost {
29 var req slides.BatchUpdatePresentationRequest
30 if err := json.NewDecoder(r.Body).Decode(&req); err == nil {
31 *captured = req.Requests
32 }
33 _ = json.NewEncoder(w).Encode(response)
34 return
35 }
36 http.NotFound(w, r)
37 }))
38 return srv
39}
40
41func mockSlidesPresentationBatchUpdateServer(
42 t *testing.T,

Callers 15

TestSlidesNewSlideFunction · 0.85
TestSlidesNewSlideJSONFunction · 0.85
TestSlidesDuplicateSlideFunction · 0.85
TestSlidesMoveSlideFunction · 0.85
TestSlidesMoveSlideJSONFunction · 0.85
TestSlidesStyleTextFunction · 0.85
TestSlidesLink_ClearFunction · 0.85

Calls 1

SetMethod · 0.45

Tested by

no test coverage detected