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

Function TestCheckHost

pkg/cmd/issue/artifact/shared/shared_test.go:643–675  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

641}
642
643func TestCheckHost(t *testing.T) {
644 tests := []struct {
645 name string
646 host string
647 wantErr string
648 }{
649 {
650 name: "github.com",
651 host: "github.com",
652 },
653 {
654 name: "a ghe.com host",
655 host: "monas-cafe.ghe.com",
656 },
657 {
658 name: "GitHub Enterprise Server",
659 host: "ghes.monas-cafe.example",
660 wantErr: "issue artifacts are not supported on GitHub Enterprise Server",
661 },
662 }
663
664 for _, tt := range tests {
665 t.Run(tt.name, func(t *testing.T) {
666 err := CheckHost(tt.host)
667
668 if tt.wantErr != "" {
669 require.EqualError(t, err, tt.wantErr)
670 return
671 }
672 require.NoError(t, err)
673 })
674 }
675}
676
677func TestCheckIssue(t *testing.T) {
678 tests := []struct {

Callers

nothing calls this directly

Calls 2

CheckHostFunction · 0.85
RunMethod · 0.65

Tested by

no test coverage detected