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

Function stubKeyringDeleteThenReadError

internal/config/refreshable_telemetry_test.go:359–367  ·  view source on GitHub ↗

stubKeyringDeleteThenReadError makes keyring deletes report success and every later keyring operation fail with err, so the read that verifies the removal fails.

(t *testing.T, err error)

Source from the content-addressed store, hash-verified

357// stubKeyringDeleteThenReadError makes keyring deletes report success and every later keyring operation fail with err,
358// so the read that verifies the removal fails.
359func stubKeyringDeleteThenReadError(t *testing.T, err error) {
360 t.Helper()
361 original := keyringDelete
362 t.Cleanup(func() { keyringDelete = original })
363 keyringDelete = func(string, string) error {
364 keyring.MockInitWithError(err)
365 return nil
366 }
367}
368
369func TestRefreshTelemetryReportsDirectoryOverrides(t *testing.T) {
370 authCfg := newTestAuthConfig(t)

Callers 1

TestRefreshTelemetryFunction · 0.85

Calls 2

MockInitWithErrorFunction · 0.92
HelperMethod · 0.65

Tested by

no test coverage detected