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

Function TestNormalizeRepoForAPI

pkg/cli/outcome_eval_test.go:104–123  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

102}
103
104func TestNormalizeRepoForAPI(t *testing.T) {
105 tests := []struct {
106 name string
107 repo string
108 wantOwnerRepo string
109 wantHost string
110 }{
111 {"plain owner/repo", "owner/repo", "owner/repo", ""},
112 {"GHES HOST/owner/repo", "myhost.com/owner/repo", "owner/repo", "myhost.com"},
113 {"github.com/owner/repo treated as host prefix", "github.com/owner/repo", "owner/repo", "github.com"},
114 }
115
116 for _, tt := range tests {
117 t.Run(tt.name, func(t *testing.T) {
118 ownerRepo, host := repoutil.NormalizeRepoForAPI(tt.repo)
119 assert.Equal(t, tt.wantOwnerRepo, ownerRepo, "owner/repo portion")
120 assert.Equal(t, tt.wantHost, host, "host portion")
121 })
122 }
123}
124
125func TestIsBotUser(t *testing.T) {
126 assert.True(t, isBotUser("github-actions[bot]"), "github-actions[bot] is a bot")

Callers

nothing calls this directly

Calls 2

NormalizeRepoForAPIFunction · 0.92
RunMethod · 0.45

Tested by

no test coverage detected