[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>
Этот коммит содержится в:
коммит произвёл
Jesús Espino
родитель
66cb36f5dc
Коммит
27566f6a06
@@ -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()
|
||||
|
||||
Ссылка в новой задаче
Block a user