MCPcopy Index your code
hub / github.com/cli/cli / Test_removeRun_user

Function Test_removeRun_user

pkg/cmd/secret/delete/delete_test.go:504–529  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

502}
503
504func Test_removeRun_user(t *testing.T) {
505 reg := &httpmock.Registry{}
506
507 reg.Register(
508 httpmock.REST("DELETE", "user/codespaces/secrets/cool_secret"),
509 httpmock.StatusStringResponse(204, "No Content"))
510
511 ios, _, _, _ := iostreams.Test()
512
513 opts := &DeleteOptions{
514 IO: ios,
515 HttpClient: func() (*http.Client, error) {
516 return &http.Client{Transport: reg}, nil
517 },
518 Config: func() (gh.Config, error) {
519 return config.NewBlankConfig(), nil
520 },
521 SecretName: "cool_secret",
522 UserSecrets: true,
523 }
524
525 err := removeRun(opts)
526 assert.NoError(t, err)
527
528 reg.Verify(t)
529}

Callers

nothing calls this directly

Calls 7

RegisterMethod · 0.95
VerifyMethod · 0.95
RESTFunction · 0.92
StatusStringResponseFunction · 0.92
TestFunction · 0.92
NewBlankConfigFunction · 0.92
removeRunFunction · 0.70

Tested by

no test coverage detected