All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m4s
修复不安全类型断言可能导致panic的问题,将Redis清理移出事务并添加超时控制 增加代理层超时配置和详细日志,提升接口稳定性
18 lines
362 B
Go
18 lines
362 B
Go
package user
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/perfect-panel/server/internal/svc"
|
|
)
|
|
|
|
func TestGetDeviceList_MissingUserContext(t *testing.T) {
|
|
l := NewGetDeviceListLogic(context.Background(), &svc.ServiceContext{})
|
|
_, err := l.GetDeviceList()
|
|
if err == nil {
|
|
t.Fatalf("expected error when user context missing")
|
|
}
|
|
}
|
|
|