实现七月迭代公共技术基础
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 9m20s
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 9m20s
This commit is contained in:
17
pkg/queue/client_test.go
Normal file
17
pkg/queue/client_test.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package queue
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
func TestEnqueueTaskRejectsPreSerializedBytesBeforeQueueAccess(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
client := &Client{logger: zap.NewNop()}
|
||||
if err := client.EnqueueTask(context.Background(), "test:bytes", []byte(`{"task_id":1}`)); err == nil {
|
||||
t.Fatal("预序列化 []byte 载荷必须在访问 Asynq 前被拒绝")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user