clean up
This commit is contained in:
parent
e14d7a4428
commit
dcc1efa2bd
4 changed files with 3 additions and 7 deletions
|
|
@ -45,10 +45,6 @@ func (a *AutolinkCreator) Create(repo ghrepo.Interface, request AutolinkCreateRe
|
|||
|
||||
defer resp.Body.Close()
|
||||
|
||||
// if resp.StatusCode != http.StatusCreated {
|
||||
// return nil, api.HandleHTTPError(resp)
|
||||
// }
|
||||
|
||||
err = handleAutolinkCreateError(resp)
|
||||
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ func TestDeleteRun(t *testing.T) {
|
|||
return nil
|
||||
}
|
||||
},
|
||||
wantStdout: "Autolink 123 has key prefix TICKET-.✓ Autolink 123 deleted from OWNER/REPO\n",
|
||||
wantStdout: "Autolink 123 has key prefix TICKET-.✓Autolink 123 deleted from OWNER/REPO\n",
|
||||
},
|
||||
{
|
||||
name: "delete with confirm flag",
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ func (a *AutolinkViewer) View(repo ghrepo.Interface, id string) (*shared.Autolin
|
|||
defer resp.Body.Close()
|
||||
|
||||
if resp.StatusCode == http.StatusNotFound {
|
||||
return nil, fmt.Errorf("HTTP 404: Either no autolink with this ID exists for this repository or you are missing admin rights to the repository. (https://api.github.com/%s)", path)
|
||||
return nil, fmt.Errorf("HTTP 404: Perhaps you are missing admin rights to the repository? (https://api.github.com/%s)", path)
|
||||
} else if resp.StatusCode > 299 {
|
||||
return nil, api.HandleHTTPError(resp)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ func TestAutolinkViewer_View(t *testing.T) {
|
|||
"status": "404"
|
||||
}`,
|
||||
expectErr: true,
|
||||
expectedErrMsg: "HTTP 404: Either no autolink with this ID exists for this repository or you are missing admin rights to the repository. (https://api.github.com/repos/OWNER/REPO/autolinks/123)",
|
||||
expectedErrMsg: "HTTP 404: Perhaps you are missing admin rights to the repository? (https://api.github.com/repos/OWNER/REPO/autolinks/123)",
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue