Test validates 'ErrEntityTooLarge' error response.
(t *testing.T)
| 196 | |
| 197 | // Test validates 'ErrEntityTooLarge' error response. |
| 198 | func 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. |
| 214 | func TestErrEntityTooSmall(t *testing.T) { |
nothing calls this directly
no test coverage detected