Files
bopx/platform_test.go
T
2025-10-12 18:41:05 +08:00

32 lines
540 B
Go

package bopx_test
import (
"context"
"testing"
"code.yun.ink/pkg/bopx"
)
func TestGetSign(t *testing.T) {
params := map[string]interface{}{
"name": "huang",
"age": 18,
}
// delete(params, "platform_key")
// delete(params, "sign")
// delete(params, "key")
s := bopx.NewPlatform()
sign, err := s.GetSign(context.Background(), "huangxinyun", params)
if err != nil {
t.Error(err)
}
t.Log(sign)
params["sign"] = sign
err = s.VerifySign(context.Background(), "huangxinyun", params)
if err != nil {
t.Error(err)
}
}