NewTestServer creates and starts new http.TestServer
()
| 56 | |
| 57 | // NewTestServer creates and starts new http.TestServer |
| 58 | func NewTestServer() *TestServer { |
| 59 | ts := &TestServer{ |
| 60 | status: http.StatusOK, |
| 61 | header: make(http.Header), |
| 62 | data: nil, |
| 63 | hook: nil, |
| 64 | } |
| 65 | |
| 66 | return ts.start() |
| 67 | } |
| 68 | |
| 69 | // SetStatusCode sets the status code that will be returned by the server |
| 70 | func (s *TestServer) SetStatusCode(status int) *TestServer { |
no test coverage detected