MCPcopy Create free account
hub / github.com/cli/cli / TestCheckHost

Function TestCheckHost

internal/attachments/client_test.go:553–580  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

551}
552
553func TestCheckHost(t *testing.T) {
554 tests := []struct {
555 name string
556 host string
557 wantErr string
558 }{
559 {name: "github.com", host: "github.com"},
560 {name: "data residency tenant", host: "acme.ghe.com"},
561 {name: "localhost", host: "github.localhost"},
562 {
563 name: "enterprise server",
564 host: "github.example.com",
565 wantErr: "attaching files is not supported on GitHub Enterprise Server",
566 },
567 }
568
569 for _, tt := range tests {
570 t.Run(tt.name, func(t *testing.T) {
571 err := checkHost(tt.host)
572
573 if tt.wantErr == "" {
574 require.NoError(t, err)
575 return
576 }
577 require.EqualError(t, err, tt.wantErr)
578 })
579 }
580}

Callers

nothing calls this directly

Calls 2

checkHostFunction · 0.85
RunMethod · 0.65

Tested by

no test coverage detected