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

Function TestErrEntityTooSmall

api-error-response_test.go:214–227  ·  view source on GitHub ↗

Test validates 'ErrEntityTooSmall' error response.

(t *testing.T)

Source from the content-addressed store, hash-verified

212
213// Test validates 'ErrEntityTooSmall' error response.
214func TestErrEntityTooSmall(t *testing.T) {
215 msg := fmt.Sprintf("Your proposed upload size ‘%d’ is below the minimum allowed object size ‘0B’ for single PUT operation.", -1)
216 expectedResult := ErrorResponse{
217 StatusCode: http.StatusBadRequest,
218 Code: EntityTooSmall,
219 Message: msg,
220 BucketName: "minio-bucket",
221 Key: "Asia/",
222 }
223 actualResult := errEntityTooSmall(-1, "minio-bucket", "Asia/")
224 if !reflect.DeepEqual(expectedResult, actualResult) {
225 t.Errorf("Expected result to be '%#v', but instead got '%#v'", expectedResult, actualResult)
226 }
227}
228
229// Test validates 'ErrUnexpectedEOF' error response.
230func TestErrUnexpectedEOF(t *testing.T) {

Callers

nothing calls this directly

Calls 1

errEntityTooSmallFunction · 0.85

Tested by

no test coverage detected