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

Function TestPrompt_expiring_decline

pkg/cmd/auth/shared/git_credential_test.go:233–252  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

231}
232
233func TestPrompt_expiring_decline(t *testing.T) {
234 ios, _, _, _ := iostreams.Test()
235 f := GitCredentialFlow{
236 IO: ios,
237 Prompter: &prompter.PrompterMock{
238 SelectFunc: func(_, _ string, options []string) (int, error) {
239 return slices.Index(options, "Continue without it (you manage Git credentials yourself)"), nil
240 },
241 },
242 HelperConfig: &stubHelperConfig{helper: gitcredentials.Helper{Cmd: "osxkeychain"}},
243 }
244
245 err := f.Prompt("github.com", true)
246 if err != nil {
247 t.Fatalf("Prompt() error = %v", err)
248 }
249 if f.ShouldSetup() {
250 t.Error("ShouldSetup() = true, want false after declining to configure gh")
251 }
252}
253
254func TestPrompt_expiring_stop(t *testing.T) {
255 ios, _, _, _ := iostreams.Test()

Callers

nothing calls this directly

Calls 4

PromptMethod · 0.95
ShouldSetupMethod · 0.95
TestFunction · 0.92
ErrorMethod · 0.45

Tested by

no test coverage detected