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

Function uploadTokenConfigForHosts

pkg/cmd/pr/create/create_test.go:2086–2096  ·  view source on GitHub ↗

A row can give the default host a different token from the host its base repository resolves to.

(tokens map[string]string)

Source from the content-addressed store, hash-verified

2084// A row can give the default host a different token from the host its base
2085// repository resolves to.
2086func uploadTokenConfigForHosts(tokens map[string]string) func() (gh.Config, error) {
2087 var b strings.Builder
2088 b.WriteString("hosts:\n")
2089 for host, token := range tokens {
2090 fmt.Fprintf(&b, " %s:\n user: monalisa\n oauth_token: %s\n", host, token)
2091 }
2092
2093 return func() (gh.Config, error) {
2094 return config.NewMockConfigFromString(b.String()), nil
2095 }
2096}
2097
2098func Test_createRun_GHES(t *testing.T) {
2099 tests := []struct {

Callers 2

Test_createRunFunction · 0.85
uploadTokenConfigFunction · 0.85

Calls 2

NewMockConfigFromStringFunction · 0.92
StringMethod · 0.65

Tested by

no test coverage detected