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

Function TestCheckHost

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

Source from the content-addressed store, hash-verified

490}
491
492func TestCheckHost(t *testing.T) {
493 tests := []struct {
494 name string
495 host string
496 wantErr string
497 }{
498 {name: "github.com", host: "github.com"},
499 {name: "data residency tenant", host: "acme.ghe.com"},
500 {name: "localhost", host: "github.localhost"},
501 {
502 name: "enterprise server",
503 host: "github.example.com",
504 wantErr: "attaching files is not supported on GitHub Enterprise Server",
505 },
506 }
507
508 for _, tt := range tests {
509 t.Run(tt.name, func(t *testing.T) {
510 err := checkHost(tt.host)
511
512 if tt.wantErr == "" {
513 require.NoError(t, err)
514 return
515 }
516 require.EqualError(t, err, tt.wantErr)
517 })
518 }
519}

Callers

nothing calls this directly

Calls 2

checkHostFunction · 0.85
RunMethod · 0.65

Tested by

no test coverage detected