Skip to content

Commit d30fb5a

Browse files
committed
temporarily renamed some test files to improve package readability for squashing
1 parent 66582e2 commit d30fb5a

File tree

4 files changed

+1
-15
lines changed

4 files changed

+1
-15
lines changed

response/error.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,12 @@ func parseHTMLResponse(bodyBytes []byte, apiError *APIError) {
177177
}
178178
}
179179

180-
parse(doc) // Start parsing the document.
180+
parse(doc)
181181

182182
// Concatenate all accumulated messages and links with a separator.
183183
if len(messages) > 0 {
184184
apiError.Message = strings.Join(messages, "; ")
185185
} else {
186-
// Fallback error message if no specific content was extracted.
187186
apiError.Message = "HTML Error: See 'Raw' field for details."
188187
}
189188

response/status.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,6 @@ import (
77
)
88

99
// IsRedirectStatusCode checks if the provided HTTP status code is one of the redirect codes.
10-
// Redirect status codes instruct the client to make a new request to a different URI, as defined in the response's Location header.
11-
//
12-
// - 301 Moved Permanently: The requested resource has been assigned a new permanent URI and any future references to this resource should use one of the returned URIs.
13-
// - 302 Found: The requested resource resides temporarily under a different URI. Since the redirection might be altered on occasion, the client should continue to use the Request-URI for future requests.
14-
// - 303 See Other: The response to the request can be found under a different URI and should be retrieved using a GET method on that resource. This method exists primarily to allow the output of a POST-activated script to redirect the user agent to a selected resource.
15-
// - 307 Temporary Redirect: The requested resource resides temporarily under a different URI. The client should not change the request method if it performs an automatic redirection to that URI.
16-
// - 308 Permanent Redirect: The request and all future requests should be repeated using another URI. 308 parallel the behavior of 301 but do not allow the HTTP method to change. So, for example, submitting a form to a permanently redirected resource may continue smoothly.
17-
//
18-
// The function returns true if the statusCode is one of the above redirect statuses, indicating that the client should follow the redirection as specified in the Location header of the response.
1910
func IsRedirectStatusCode(statusCode int) bool {
2011
switch statusCode {
2112
case http.StatusMovedPermanently,
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@ func TestHandleDeleteRequest_Success(t *testing.T) {
2222
},
2323
}
2424

25-
// Call handleDeleteRequest with a nil logger since logging is ignored in this test
2625
err := handleDeleteRequest(resp, nil)
2726

28-
// No error is expected for a successful DELETE request
2927
assert.NoError(t, err, "handleDeleteRequest should not return an error for successful DELETE requests")
3028
}
3129

@@ -42,9 +40,7 @@ func TestHandleDeleteRequest_Failure(t *testing.T) {
4240
},
4341
}
4442

45-
// Call handleDeleteRequest with a nil logger since logging is ignored in this test
4643
err := handleDeleteRequest(resp, nil)
4744

48-
// An error is expected for a failed DELETE request
4945
assert.Error(t, err, "handleDeleteRequest should return an error for failed DELETE requests")
5046
}

0 commit comments

Comments
 (0)