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