@@ -84,7 +84,7 @@ func (c *apiTestClient) Do(ctx context.Context, req *http.Request) (*http.Respon
84
84
if test .inStatusCode != 0 {
85
85
resp .StatusCode = test .inStatusCode
86
86
} else if test .inErr != nil {
87
- resp .StatusCode = statusAPIError
87
+ resp .StatusCode = http . StatusUnprocessableEntity
88
88
} else {
89
89
resp .StatusCode = http .StatusOK
90
90
}
@@ -1118,7 +1118,7 @@ func (c *testClient) Do(ctx context.Context, req *http.Request) (*http.Response,
1118
1118
func TestAPIClientDo (t * testing.T ) {
1119
1119
tests := []apiClientTest {
1120
1120
{
1121
- code : statusAPIError ,
1121
+ code : http . StatusUnprocessableEntity ,
1122
1122
response : & apiResponse {
1123
1123
Status : "error" ,
1124
1124
Data : json .RawMessage (`null` ),
@@ -1132,7 +1132,7 @@ func TestAPIClientDo(t *testing.T) {
1132
1132
expectedBody : `null` ,
1133
1133
},
1134
1134
{
1135
- code : statusAPIError ,
1135
+ code : http . StatusUnprocessableEntity ,
1136
1136
response : & apiResponse {
1137
1137
Status : "error" ,
1138
1138
Data : json .RawMessage (`"test"` ),
@@ -1177,15 +1177,15 @@ func TestAPIClientDo(t *testing.T) {
1177
1177
},
1178
1178
},
1179
1179
{
1180
- code : statusAPIError ,
1180
+ code : http . StatusUnprocessableEntity ,
1181
1181
response : "bad json" ,
1182
1182
expectedErr : & Error {
1183
1183
Type : ErrBadResponse ,
1184
1184
Msg : "readObjectStart: expect { or n, but found b, error found in #1 byte of ...|bad json|..., bigger context ...|bad json|..." ,
1185
1185
},
1186
1186
},
1187
1187
{
1188
- code : statusAPIError ,
1188
+ code : http . StatusUnprocessableEntity ,
1189
1189
response : & apiResponse {
1190
1190
Status : "success" ,
1191
1191
Data : json .RawMessage (`"test"` ),
@@ -1196,7 +1196,7 @@ func TestAPIClientDo(t *testing.T) {
1196
1196
},
1197
1197
},
1198
1198
{
1199
- code : statusAPIError ,
1199
+ code : http . StatusUnprocessableEntity ,
1200
1200
response : & apiResponse {
1201
1201
Status : "success" ,
1202
1202
Data : json .RawMessage (`"test"` ),
0 commit comments