修复后端全量测试环境兼容问题

修正 Windows 本地回环 SFTP 测试的远程绝对路径映射,并避免在不支持 POSIX 权限位的环境中误判上传临时文件权限。后端全量测试和 go vet 已通过。
This commit is contained in:
xuans committed 2026-10-03 02:48:07 +08:00
1 parent e1f9b4d6f0
commit 857fb0e632
3 files changed
+22 -8

No files matched your search

@@ -10,6 +10,7 @@ import (
"net/http/httptest"
"os"
"path/filepath"
"runtime"
"strings"
"sync/atomic"
"testing"
@@ -60,7 +61,7 @@ func TestAsyncImportUploadLifecycle(t *testing.T) {
t.Errorf("上传文件被提前回收或内容变化:%v", err)
}
info, err := os.Stat(path)
if err != nil || info.Mode().Perm() != 0600 {
if err != nil || (runtime.GOOS != "windows" && info.Mode().Perm() != 0600) {
t.Errorf("上传文件权限错误:%v", err)
}
}