improve test cases
This commit is contained in:
parent
b83342856b
commit
bba2d6d204
1 changed files with 5 additions and 5 deletions
|
|
@ -757,7 +757,7 @@ func Test_fillPlaceholders(t *testing.T) {
|
|||
{
|
||||
name: "has branch placeholder",
|
||||
args: args{
|
||||
value: "repos/cli/cli/branches/:branch",
|
||||
value: "repos/cli/cli/branches/:branch/protection/required_status_checks",
|
||||
opts: &ApiOptions{
|
||||
BaseRepo: func() (ghrepo.Interface, error) {
|
||||
return ghrepo.New("cli", "cli"), nil
|
||||
|
|
@ -767,13 +767,13 @@ func Test_fillPlaceholders(t *testing.T) {
|
|||
},
|
||||
},
|
||||
},
|
||||
want: "repos/cli/cli/branches/trunk",
|
||||
want: "repos/cli/cli/branches/trunk/protection/required_status_checks",
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "has branch placeholder and git is on detached head",
|
||||
name: "has branch placeholder and git is in detached head",
|
||||
args: args{
|
||||
value: "repos/cli/cli/branches/:branch",
|
||||
value: "repos/:owner/:repo/branches/:branch",
|
||||
opts: &ApiOptions{
|
||||
BaseRepo: func() (ghrepo.Interface, error) {
|
||||
return ghrepo.New("cli", "cli"), nil
|
||||
|
|
@ -783,7 +783,7 @@ func Test_fillPlaceholders(t *testing.T) {
|
|||
},
|
||||
},
|
||||
},
|
||||
want: "repos/cli/cli/branches/:branch",
|
||||
want: "repos/:owner/:repo/branches/:branch",
|
||||
wantErr: true,
|
||||
},
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue