MCPcopy
hub / github.com/minio/minio-go / TestErrUnexpectedEOF

Function TestErrUnexpectedEOF

api-error-response_test.go:230–244  ·  view source on GitHub ↗

Test validates 'ErrUnexpectedEOF' error response.

(t *testing.T)

Source from the content-addressed store, hash-verified

228
229// Test validates 'ErrUnexpectedEOF' error response.
230func TestErrUnexpectedEOF(t *testing.T) {
231 msg := fmt.Sprintf("Data read ‘%s’ is not equal to the size ‘%s’ of the input Reader.",
232 strconv.FormatInt(100, 10), strconv.FormatInt(101, 10))
233 expectedResult := ErrorResponse{
234 StatusCode: http.StatusBadRequest,
235 Code: UnexpectedEOF,
236 Message: msg,
237 BucketName: "minio-bucket",
238 Key: "Asia/",
239 }
240 actualResult := errUnexpectedEOF(100, 101, "minio-bucket", "Asia/")
241 if !reflect.DeepEqual(expectedResult, actualResult) {
242 t.Errorf("Expected result to be '%#v', but instead got '%#v'", expectedResult, actualResult)
243 }
244}
245
246// Test validates 'errInvalidArgument' response.
247func TestErrInvalidArgument(t *testing.T) {

Callers

nothing calls this directly

Calls 1

errUnexpectedEOFFunction · 0.85

Tested by

no test coverage detected