(t *testing.T)
| 83 | } |
| 84 | |
| 85 | func TestHTTPError(t *testing.T) { |
| 86 | assert := New(t) |
| 87 | |
| 88 | mockT1 := new(testing.T) |
| 89 | assert.Equal(HTTPError(mockT1, httpOK, "GET", "/", nil), false) |
| 90 | assert.True(mockT1.Failed()) |
| 91 | |
| 92 | mockT2 := new(mockTestingT) |
| 93 | assert.Equal(HTTPError( |
| 94 | mockT2, httpRedirect, "GET", "/", nil, |
| 95 | "Expected this request to error out. But it didn't", |
| 96 | ), false) |
| 97 | assert.True(mockT2.Failed()) |
| 98 | assert.Contains(mockT2.errorString(), "Expected this request to error out. But it didn't") |
| 99 | |
| 100 | mockT3 := new(testing.T) |
| 101 | assert.Equal(HTTPError(mockT3, httpError, "GET", "/", nil), true) |
| 102 | assert.False(mockT3.Failed()) |
| 103 | |
| 104 | mockT4 := new(testing.T) |
| 105 | assert.Equal(HTTPError(mockT4, httpStatusCode, "GET", "/", nil), false) |
| 106 | assert.True(mockT4.Failed()) |
| 107 | } |
| 108 | |
| 109 | func TestHTTPStatusCode(t *testing.T) { |
| 110 | assert := New(t) |
nothing calls this directly
no test coverage detected
searching dependent graphs…