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

Function TestCheckHost

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

checkHostFunction · 0.85
RunMethod · 0.65

Tested by

no test coverage detected