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

Function TestErrEntityTooLarge

api-error-response_test.go:198–211  ·  view source on GitHub ↗

Test validates 'ErrEntityTooLarge' error response.

(t *testing.T)

Source from the content-addressed store, hash-verified

196
197// Test validates 'ErrEntityTooLarge' error response.
198func TestErrEntityTooLarge(t *testing.T) {
199 msg := fmt.Sprintf("Your proposed upload size ‘%d’ exceeds the maximum allowed object size ‘%d’ for single PUT operation.", 1000000, 99999)
200 expectedResult := ErrorResponse{
201 StatusCode: http.StatusBadRequest,
202 Code: EntityTooLarge,
203 Message: msg,
204 BucketName: "minio-bucket",
205 Key: "Asia/",
206 }
207 actualResult := errEntityTooLarge(1000000, 99999, "minio-bucket", "Asia/")
208 if !reflect.DeepEqual(expectedResult, actualResult) {
209 t.Errorf("Expected result to be '%#v', but instead got '%#v'", expectedResult, actualResult)
210 }
211}
212
213// Test validates 'ErrEntityTooSmall' error response.
214func TestErrEntityTooSmall(t *testing.T) {

Callers

nothing calls this directly

Calls 1

errEntityTooLargeFunction · 0.85

Tested by

no test coverage detected