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

Function Test_setRun_org

pkg/cmd/secret/set/set_test.go:538–701  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

536}
537
538func Test_setRun_org(t *testing.T) {
539 tests := []struct {
540 name string
541 opts *SetOptions
542 wantVisibility shared.Visibility
543 wantRepositories []int64
544 wantDependabotRepositories []string
545 wantApp string
546 }{
547 {
548 name: "all vis",
549 opts: &SetOptions{
550 OrgName: "UmbrellaCorporation",
551 Visibility: shared.All,
552 },
553 wantApp: "actions",
554 },
555 {
556 name: "selected visibility",
557 opts: &SetOptions{
558 OrgName: "UmbrellaCorporation",
559 Visibility: shared.Selected,
560 RepositoryNames: []string{"birkin", "UmbrellaCorporation/wesker"},
561 },
562 wantRepositories: []int64{1, 2},
563 wantApp: "actions",
564 },
565 {
566 name: "no repos visibility",
567 opts: &SetOptions{
568 OrgName: "UmbrellaCorporation",
569 Visibility: shared.Selected,
570 RepositoryNames: []string{},
571 },
572 wantRepositories: []int64{},
573 wantApp: "actions",
574 },
575 {
576 name: "Dependabot",
577 opts: &SetOptions{
578 OrgName: "UmbrellaCorporation",
579 Visibility: shared.All,
580 Application: shared.Dependabot,
581 },
582 wantApp: "dependabot",
583 },
584 {
585 name: "Dependabot selected visibility",
586 opts: &SetOptions{
587 OrgName: "UmbrellaCorporation",
588 Visibility: shared.Selected,
589 Application: shared.Dependabot,
590 RepositoryNames: []string{"birkin", "UmbrellaCorporation/wesker"},
591 },
592 wantDependabotRepositories: []string{"1", "2"},
593 wantApp: "dependabot",
594 },
595 {

Callers

nothing calls this directly

Calls 13

RegisterMethod · 0.95
VerifyMethod · 0.95
RESTFunction · 0.92
JSONResponseFunction · 0.92
StatusStringResponseFunction · 0.92
GraphQLFunction · 0.92
StringResponseFunction · 0.92
TestFunction · 0.92
FromFullNameFunction · 0.92
NewBlankConfigFunction · 0.92
EqualMethod · 0.80
setRunFunction · 0.70

Tested by

no test coverage detected