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

Function TestAPIResponse_IsNotFound

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

Source from the content-addressed store, hash-verified

462}
463
464func TestAPIResponse_IsNotFound(t *testing.T) {
465 tests := []struct {
466 code int
467 expect bool
468 }{
469 {404, true},
470 {200, false},
471 {403, false},
472 {500, false},
473 }
474
475 for _, tt := range tests {
476 resp := &lib.APIResponse{StatusCode: tt.code}
477 if resp.IsNotFound() != tt.expect {
478 t.Errorf("IsNotFound() for %d: expected %v", tt.code, tt.expect)
479 }
480 }
481}
482
483func TestAPIResponse_FormatJSON(t *testing.T) {
484 resp := &lib.APIResponse{

Callers

nothing calls this directly

Calls 1

IsNotFoundMethod · 0.95

Tested by

no test coverage detected