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

Function Test_removeRun_org

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

Source from the content-addressed store, hash-verified

433}
434
435func Test_removeRun_org(t *testing.T) {
436 tests := []struct {
437 name string
438 opts *DeleteOptions
439 wantPath string
440 }{
441 {
442 name: "org",
443 opts: &DeleteOptions{
444 OrgName: "UmbrellaCorporation",
445 },
446 wantPath: "orgs/UmbrellaCorporation/actions/secrets/tVirus",
447 },
448 {
449 name: "Dependabot org",
450 opts: &DeleteOptions{
451 Application: "dependabot",
452 OrgName: "UmbrellaCorporation",
453 },
454 wantPath: "orgs/UmbrellaCorporation/dependabot/secrets/tVirus",
455 },
456 {
457 name: "Codespaces org",
458 opts: &DeleteOptions{
459 Application: "codespaces",
460 OrgName: "UmbrellaCorporation",
461 },
462 wantPath: "orgs/UmbrellaCorporation/codespaces/secrets/tVirus",
463 },
464 {
465 name: "Agents org",
466 opts: &DeleteOptions{
467 Application: "agents",
468 OrgName: "UmbrellaCorporation",
469 },
470 wantPath: "orgs/UmbrellaCorporation/agents/secrets/tVirus",
471 },
472 }
473
474 for _, tt := range tests {
475 t.Run(tt.name, func(t *testing.T) {
476 reg := &httpmock.Registry{}
477
478 reg.Register(
479 httpmock.REST("DELETE", tt.wantPath),
480 httpmock.StatusStringResponse(204, "No Content"))
481
482 ios, _, _, _ := iostreams.Test()
483
484 tt.opts.Config = func() (gh.Config, error) {
485 return config.NewBlankConfig(), nil
486 }
487 tt.opts.BaseRepo = func() (ghrepo.Interface, error) {
488 return ghrepo.FromFullName("owner/repo")
489 }
490 tt.opts.HttpClient = func() (*http.Client, error) {
491 return &http.Client{Transport: reg}, nil
492 }

Callers

nothing calls this directly

Calls 9

RegisterMethod · 0.95
VerifyMethod · 0.95
RESTFunction · 0.92
StatusStringResponseFunction · 0.92
TestFunction · 0.92
NewBlankConfigFunction · 0.92
FromFullNameFunction · 0.92
removeRunFunction · 0.70
RunMethod · 0.65

Tested by

no test coverage detected