(t *testing.T)
| 661 | } |
| 662 | |
| 663 | func TestGetSetsErrorStatusWhenHTTPResponseStatusIsNotOK(t *testing.T) { |
| 664 | t.Parallel() |
| 665 | // With no handler, all requests will get 404 |
| 666 | ts := httptest.NewServer(nil) |
| 667 | defer ts.Close() |
| 668 | p := script.Get(ts.URL) |
| 669 | p.Wait() |
| 670 | if p.Error() == nil { |
| 671 | t.Fatalf("want error for non-OK request, got nil") |
| 672 | } |
| 673 | } |
| 674 | |
| 675 | func TestGetConsidersHTTPStatus201CreatedToBeOK(t *testing.T) { |
| 676 | t.Parallel() |