@@ -77,7 +77,7 @@ func TestAPICreatePullSuccess(t *testing.T) {
7777 Base : "master" ,
7878 Title : "create a failure pr" ,
7979 })
80- session .MakeRequest (t , req , 201 )
80+ session .MakeRequest (t , req , http . StatusCreated )
8181 session .MakeRequest (t , req , http .StatusUnprocessableEntity ) // second request should fail
8282}
8383
@@ -105,7 +105,7 @@ func TestAPICreatePullWithFieldsSuccess(t *testing.T) {
105105
106106 req := NewRequestWithJSON (t , http .MethodPost , fmt .Sprintf ("/api/v1/repos/%s/%s/pulls?token=%s" , owner10 .Name , repo10 .Name , token ), opts )
107107
108- res := session .MakeRequest (t , req , 201 )
108+ res := session .MakeRequest (t , req , http . StatusCreated )
109109 pull := new (api.PullRequest )
110110 DecodeJSON (t , res , pull )
111111
@@ -165,20 +165,20 @@ func TestAPIEditPull(t *testing.T) {
165165 Title : "create a success pr" ,
166166 })
167167 pull := new (api.PullRequest )
168- resp := session .MakeRequest (t , req , 201 )
168+ resp := session .MakeRequest (t , req , http . StatusCreated )
169169 DecodeJSON (t , resp , pull )
170170 assert .EqualValues (t , "master" , pull .Base .Name )
171171
172172 req = NewRequestWithJSON (t , http .MethodPatch , fmt .Sprintf ("/api/v1/repos/%s/%s/pulls/%d?token=%s" , owner10 .Name , repo10 .Name , pull .Index , token ), & api.EditPullRequestOption {
173173 Base : "feature/1" ,
174174 Title : "edit a this pr" ,
175175 })
176- resp = session .MakeRequest (t , req , 201 )
176+ resp = session .MakeRequest (t , req , http . StatusCreated )
177177 DecodeJSON (t , resp , pull )
178178 assert .EqualValues (t , "feature/1" , pull .Base .Name )
179179
180180 req = NewRequestWithJSON (t , http .MethodPatch , fmt .Sprintf ("/api/v1/repos/%s/%s/pulls/%d?token=%s" , owner10 .Name , repo10 .Name , pull .Index , token ), & api.EditPullRequestOption {
181181 Base : "not-exist" ,
182182 })
183- session .MakeRequest (t , req , 404 )
183+ session .MakeRequest (t , req , http . StatusNotFound )
184184}
0 commit comments