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

Function newTestAuthConfig

internal/config/auth_config_test.go:17–30  ·  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

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

Calls 1

NewIsolatedTestConfigFunction · 0.85

Tested by

no test coverage detected