(t *testing.T)
| 31 | } |
| 32 | |
| 33 | func TestHTTPSuccess(t *testing.T) { |
| 34 | t.Parallel() |
| 35 | |
| 36 | assert := New(t) |
| 37 | |
| 38 | mockT1 := new(testing.T) |
| 39 | assert.Equal(HTTPSuccess(mockT1, httpOK, "GET", "/", nil), true) |
| 40 | assert.False(mockT1.Failed()) |
| 41 | |
| 42 | mockT2 := new(testing.T) |
| 43 | assert.Equal(HTTPSuccess(mockT2, httpRedirect, "GET", "/", nil), false) |
| 44 | assert.True(mockT2.Failed()) |
| 45 | |
| 46 | mockT3 := new(mockTestingT) |
| 47 | assert.Equal(HTTPSuccess( |
| 48 | mockT3, httpError, "GET", "/", nil, |
| 49 | "was not expecting a failure here", |
| 50 | ), false) |
| 51 | assert.True(mockT3.Failed()) |
| 52 | assert.Contains(mockT3.errorString(), "was not expecting a failure here") |
| 53 | |
| 54 | mockT4 := new(testing.T) |
| 55 | assert.Equal(HTTPSuccess(mockT4, httpStatusCode, "GET", "/", nil), false) |
| 56 | assert.True(mockT4.Failed()) |
| 57 | |
| 58 | mockT5 := new(testing.T) |
| 59 | assert.Equal(HTTPSuccess(mockT5, httpReadBody, "POST", "/", nil), true) |
| 60 | assert.False(mockT5.Failed()) |
| 61 | } |
| 62 | |
| 63 | func TestHTTPRedirect(t *testing.T) { |
| 64 | t.Parallel() |
nothing calls this directly
no test coverage detected