fix: incorrect progress count (#1379)

* fix: incorrect progress count

文件中转 已完成文件计数 应在文件成功上传后+1 #1367

* fix failed ut

Co-authored-by: HFO4 <912394456@qq.com>
This commit is contained in:
小白-白
2022-07-12 19:30:41 +08:00
committed by GitHub
parent c99b36f788
commit 9869671633
2 changed files with 5 additions and 13 deletions

View File

@@ -88,11 +88,6 @@ func TestTransferTask_Do(t *testing.T) {
}
task.TaskProps.Src = []string{"test/not_exist"}
task.TaskProps.Parent = "test/not_exist"
// 更新进度
mock.ExpectBegin()
mock.ExpectExec("UPDATE(.+)").WillReturnResult(sqlmock.NewResult(1,
1))
mock.ExpectCommit()
// 更新错误
mock.ExpectBegin()
mock.ExpectExec("UPDATE(.+)").WillReturnResult(sqlmock.NewResult(1,
@@ -113,11 +108,6 @@ func TestTransferTask_Do(t *testing.T) {
task.TaskProps.Src = []string{"test/not_exist"}
task.TaskProps.Parent = "test/not_exist"
task.TaskProps.TrimPath = true
// 更新进度
mock.ExpectBegin()
mock.ExpectExec("UPDATE(.+)").WillReturnResult(sqlmock.NewResult(1,
1))
mock.ExpectCommit()
// 更新错误
mock.ExpectBegin()
mock.ExpectExec("UPDATE(.+)").WillReturnResult(sqlmock.NewResult(1,