[MM-13033] Continue bulk import on large image error (#10780)

* [MM-13033] Continue bulk import on large image error

* add tests, review comments

* Update app/import_functions.go

Co-Authored-By: liusy182 <liusy182@hotmail.com>
Этот коммит содержится в:
Siyuan Liu
2019-05-08 13:29:42 -07:00
коммит произвёл Jesús Espino
родитель 66cb36f5dc
Коммит 27566f6a06
3 изменённых файлов: 43 добавлений и 9 удалений

Просмотреть файл

@@ -4,6 +4,7 @@
package app
import (
"net/http"
"path/filepath"
"runtime/debug"
"strings"
@@ -159,6 +160,23 @@ func TestImportImportLine(t *testing.T) {
}
}
func TestStopOnError(t *testing.T) {
assert.True(t, stopOnError(LineImportWorkerError{
model.NewAppError("test", "app.import.attachment.bad_file.error", nil, "", http.StatusBadRequest),
1,
}))
assert.True(t, stopOnError(LineImportWorkerError{
model.NewAppError("test", "app.import.attachment.file_upload.error", nil, "", http.StatusBadRequest),
1,
}))
assert.False(t, stopOnError(LineImportWorkerError{
model.NewAppError("test", "api.file.upload_file.large_image.app_error", nil, "", http.StatusBadRequest),
1,
}))
}
func TestImportBulkImport(t *testing.T) {
th := Setup(t)
defer th.TearDown()