MCPcopy
hub / github.com/cli/cli / TestHasEnvTokenWithEnvToken

Function TestHasEnvTokenWithEnvToken

internal/config/auth_config_test.go:146–157  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

144}
145
146func TestHasEnvTokenWithEnvToken(t *testing.T) {
147 // Given we have an env token set
148 // Note that any valid env var for tokens will do, not just GH_ENTERPRISE_TOKEN
149 authCfg := newTestAuthConfig(t)
150 t.Setenv("GH_ENTERPRISE_TOKEN", "test-token")
151
152 // When we check if it has an env token
153 hasEnvToken := authCfg.HasEnvToken()
154
155 // Then it returns true
156 require.True(t, hasEnvToken, "expected to have env token")
157}
158
159func TestHasEnvTokenWithNoEnvTokenButAConfigVar(t *testing.T) {
160 t.Skip("this test is explicitly breaking some implementation assumptions")

Callers

nothing calls this directly

Calls 2

newTestAuthConfigFunction · 0.85
HasEnvTokenMethod · 0.65

Tested by

no test coverage detected