Note that NewIsolatedTestConfig sets up a Mock keyring as well
(t *testing.T)
| 15 | |
| 16 | // Note that NewIsolatedTestConfig sets up a Mock keyring as well |
| 17 | func 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 | |
| 32 | func TestTokenFromKeyring(t *testing.T) { |
| 33 | // Given a keyring that contains a token for a host |
no test coverage detected