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

Function requireCallAPIProblem

cmd/event/runtime_test.go:65–77  ·  view source on GitHub ↗
(t *testing.T, err error, category errs.Category, subtype errs.Subtype)

Source from the content-addressed store, hash-verified

63}
64
65func requireCallAPIProblem(t *testing.T, err error, category errs.Category, subtype errs.Subtype) {
66 t.Helper()
67 if err == nil {
68 t.Fatal("expected error, got nil")
69 }
70 p, ok := errs.ProblemOf(err)
71 if !ok {
72 t.Fatalf("expected typed errs error, got %T: %v", err, err)
73 }
74 if p.Category != category || p.Subtype != subtype {
75 t.Fatalf("problem = %s/%s, want %s/%s", p.Category, p.Subtype, category, subtype)
76 }
77}
78
79func TestConsumeRuntimeCallAPI_NonJSONHTTPError(t *testing.T) {
80 r := newTestConsumeRuntime(stubRoundTripper{respond: stubResponse(http.StatusNotFound, "text/plain", "gone")})

Calls 1

ProblemOfFunction · 0.92

Tested by

no test coverage detected