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

Function TestHasEnvTokenWithEnvToken

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

Source from the content-addressed store, hash-verified

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