(t *testing.T)
| 5901 | } |
| 5902 | |
| 5903 | func Test_Ctx_SaveFileToStorage_StoreErrorIncludesPath(t *testing.T) { |
| 5904 | t.Parallel() |
| 5905 | |
| 5906 | app := New() |
| 5907 | wantErr := errors.New("backend down") |
| 5908 | storage := &failingStorage{err: wantErr} |
| 5909 | |
| 5910 | ctx := app.AcquireCtx(&fasthttp.RequestCtx{}) |
| 5911 | defer app.ReleaseCtx(ctx) |
| 5912 | |
| 5913 | fileHeader := createMultipartFileHeader(t, "report.pdf", []byte("payload")) |
| 5914 | |
| 5915 | err := ctx.SaveFileToStorage(fileHeader, "uploads/report.pdf", storage) |
| 5916 | |
| 5917 | require.Error(t, err) |
| 5918 | require.ErrorIs(t, err, ErrFileStore) |
| 5919 | require.ErrorIs(t, err, wantErr) |
| 5920 | require.Contains(t, err.Error(), "report.pdf") |
| 5921 | require.Contains(t, err.Error(), "uploads/report.pdf") |
| 5922 | } |
| 5923 | |
| 5924 | type failingStorage struct { |
| 5925 | err error |
nothing calls this directly
no test coverage detected