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

Function newTestAuthConfig

internal/config/auth_config_test.go:16–28  ·  view source on GitHub ↗

Note that NewIsolatedTestConfig sets up a Mock keyring as well

(t *testing.T)

Source from the content-addressed store, hash-verified

14
15// Note that NewIsolatedTestConfig sets up a Mock keyring as well
16func newTestAuthConfig(t *testing.T) *AuthConfig {
17 cfg, _ := NewIsolatedTestConfig(t, "")
18 // Neutralize the cross-process lock and disk reload so tests never take a real filesystem lock or read from disk.
19 return &AuthConfig{
20 cfg: cfg.cfg,
21 acquireRefreshLock: func(ctx context.Context, path string) (func(), error) {
22 return func() {}, nil
23 },
24 reloadConfig: func() error {
25 return nil
26 },
27 }
28}
29
30func TestTokenFromKeyring(t *testing.T) {
31 // Given a keyring that contains a token for a host

Calls 1

NewIsolatedTestConfigFunction · 0.85

Tested by

no test coverage detected