MCPcopy
hub / github.com/larksuite/cli / TestConsumeRuntimeCallAPI_Success

Function TestConsumeRuntimeCallAPI_Success

cmd/event/runtime_test.go:137–147  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

135}
136
137func TestConsumeRuntimeCallAPI_Success(t *testing.T) {
138 r := newTestConsumeRuntime(stubRoundTripper{respond: stubResponse(http.StatusOK, "application/json",
139 `{"code":0,"data":{"ok":true}}`)})
140 raw, err := r.CallAPI(context.Background(), "GET", "/open-apis/event/v1/connection", nil)
141 if err != nil {
142 t.Fatalf("unexpected error: %v", err)
143 }
144 if !strings.Contains(string(raw), `"code":0`) {
145 t.Errorf("raw body should pass through, got: %s", raw)
146 }
147}

Callers

nothing calls this directly

Calls 4

newTestConsumeRuntimeFunction · 0.85
stubResponseFunction · 0.70
CallAPIMethod · 0.65
ContainsMethod · 0.45

Tested by

no test coverage detected