(t *testing.T)
| 200 | } |
| 201 | |
| 202 | func TestSaveUploadedOpenFailed(t *testing.T) { |
| 203 | buf := new(bytes.Buffer) |
| 204 | mw := multipart.NewWriter(buf) |
| 205 | mw.Close() |
| 206 | |
| 207 | c, _ := CreateTestContext(httptest.NewRecorder()) |
| 208 | c.Request, _ = http.NewRequest(http.MethodPost, "/", buf) |
| 209 | c.Request.Header.Set("Content-Type", mw.FormDataContentType()) |
| 210 | |
| 211 | f := &multipart.FileHeader{ |
| 212 | Filename: "file", |
| 213 | } |
| 214 | require.Error(t, c.SaveUploadedFile(f, "test")) |
| 215 | } |
| 216 | |
| 217 | func TestSaveUploadedCreateFailed(t *testing.T) { |
| 218 | buf := new(bytes.Buffer) |
nothing calls this directly
no test coverage detected