(t *testing.T, returnIn time.Duration, counter *int32)
| 380 | } |
| 381 | |
| 382 | func fakeServer(t *testing.T, returnIn time.Duration, counter *int32) *httptest.Server { |
| 383 | server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { |
| 384 | time.Sleep(returnIn) |
| 385 | |
| 386 | atomic.AddInt32(counter, 1) |
| 387 | // return fake list response b/c it's the only call that has to succeed |
| 388 | _, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?> |
| 389 | <ListBucketResult> |
| 390 | </ListBucketResult>`)) |
| 391 | })) |
| 392 | t.Cleanup(server.Close) |
| 393 | |
| 394 | return server |
| 395 | } |
| 396 | |
| 397 | func TestReadError(t *testing.T) { |
| 398 | errA := minio.ErrorResponse{ |
no test coverage detected