MCPcopy Create free account
hub / github.com/cronitorio/cronitor-cli / TestAPIClient_URLConstruction

Function TestAPIClient_URLConstruction

lib/api_client_test.go:263–279  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

261}
262
263func TestAPIClient_URLConstruction(t *testing.T) {
264 mock := testutil.NewMockAPI()
265 defer mock.Close()
266
267 mock.On("GET", "/monitors/abc123", 200, `{}`)
268
269 client := newTestClient(mock.Server.URL)
270 _, err := client.GET("/monitors/abc123", nil)
271 if err != nil {
272 t.Fatalf("unexpected error: %v", err)
273 }
274
275 req := mock.LastRequest()
276 if req.Path != "/monitors/abc123" {
277 t.Errorf("expected /monitors/abc123, got %s", req.Path)
278 }
279}
280
281// --- Error Response Tests ---
282

Callers

nothing calls this directly

Calls 6

CloseMethod · 0.95
OnMethod · 0.95
LastRequestMethod · 0.95
NewMockAPIFunction · 0.92
newTestClientFunction · 0.85
GETMethod · 0.80

Tested by

no test coverage detected