MCPcopy Create free account
hub / github.com/github/gh-aw / TestIsNotFoundError_RemoteNested

Function TestIsNotFoundError_RemoteNested

pkg/parser/import_remote_nested_test.go:524–568  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

522}
523
524func TestIsNotFoundError_RemoteNested(t *testing.T) {
525 tests := []struct {
526 name string
527 err error
528 expected bool
529 }{
530 {
531 name: "HTTP 404 message",
532 err: errors.New("HTTP 404: Not Found"),
533 expected: true,
534 },
535 {
536 name: "lowercase not found",
537 err: errors.New("failed to fetch file: not found"),
538 expected: true,
539 },
540 {
541 name: "404 status code in message",
542 err: errors.New("server returned 404 for request"),
543 expected: true,
544 },
545 {
546 name: "authentication error",
547 err: errors.New("HTTP 401: Unauthorized"),
548 expected: false,
549 },
550 {
551 name: "server error",
552 err: errors.New("HTTP 500: Internal Server Error"),
553 expected: false,
554 },
555 {
556 name: "nil error",
557 err: nil,
558 expected: false,
559 },
560 }
561
562 for _, tt := range tests {
563 t.Run(tt.name, func(t *testing.T) {
564 result := errorutil.IsNotFoundError(tt.err)
565 assert.Equal(t, tt.expected, result, "errorutil.IsNotFoundError(%v)", tt.err)
566 })
567 }
568}
569
570func TestResolveRemoteSymlinksPathConstruction(t *testing.T) {
571 // These tests verify the path construction logic of resolveRemoteSymlinks

Callers

nothing calls this directly

Calls 2

IsNotFoundErrorFunction · 0.92
RunMethod · 0.45

Tested by

no test coverage detected