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

Function TestLoginInsecureStorage

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

Source from the content-addressed store, hash-verified

303}
304
305func TestLoginInsecureStorage(t *testing.T) {
306 // Given we are not logged in
307 authCfg := newTestAuthConfig(t)
308
309 // When we login with insecure storage
310 insecureStorageUsed, err := authCfg.Login("github.com", "test-user", "test-token", "", false)
311
312 // Then it returns success, notes that insecure storage was used, and stores the token in the config
313 require.NoError(t, err)
314
315 require.True(t, insecureStorageUsed, "expected to use insecure storage")
316 requireKeyWithValue(t, authCfg.cfg, []string{hostsKey, "github.com", oauthTokenKey}, "test-token")
317}
318
319func TestLoginSetsUserForProvidedHost(t *testing.T) {
320 // Given we are not logged in

Callers

nothing calls this directly

Calls 3

newTestAuthConfigFunction · 0.85
requireKeyWithValueFunction · 0.70
LoginMethod · 0.65

Tested by

no test coverage detected