fix: 扫码轮询改用网站接受的回调名
This commit is contained in:
@@ -37,3 +37,29 @@ func TestLiveDiscover(t *testing.T) {
|
||||
}
|
||||
t.Logf("captcha app %s fee %s plan %s", appID, fee, plan)
|
||||
}
|
||||
|
||||
func TestLiveQRPoll(t *testing.T) {
|
||||
if os.Getenv("CU_LIVE") == "" {
|
||||
t.Skip()
|
||||
}
|
||||
client, err := New()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 40*time.Second)
|
||||
defer cancel()
|
||||
img, err := client.QRCode(ctx)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if len(img) < 100 {
|
||||
t.Fatalf("qr %d", len(img))
|
||||
}
|
||||
status, err := client.PollQR(ctx)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !status.Waiting {
|
||||
t.Fatalf("status %#v", status)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user