Выпуск WDTT Plus v15
This commit is contained in:
1 parent
3d2c277b06
commit
947551c176
65 files changed
+12788
-1338
No files matched your search
@@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/url"
|
||||
"reflect"
|
||||
"testing"
|
||||
@@ -155,6 +156,21 @@ func TestVKCallsFloodPause(t *testing.T) {
|
||||
vkCallsFloodUntil.Store(0)
|
||||
}
|
||||
|
||||
func TestVKCallsPreflightPauseForError(t *testing.T) {
|
||||
if got := vkCallsPreflightPauseForError(fmt.Errorf("%w: rate limited", errVKCallsFlood)); got != vkCallsFloodPause {
|
||||
t.Fatalf("flood pause = %v, want %v", got, vkCallsFloodPause)
|
||||
}
|
||||
if got := vkCallsPreflightPauseForError(&VkCaptchaError{ErrorCode: 14}); got != vkCallsCaptchaPause {
|
||||
t.Fatalf("captcha pause = %v, want %v", got, vkCallsCaptchaPause)
|
||||
}
|
||||
if got := vkCallsPreflightPauseForError(errors.New("temporary network failure")); got != vkCallsTransientFailurePause {
|
||||
t.Fatalf("transient pause = %v, want %v", got, vkCallsTransientFailurePause)
|
||||
}
|
||||
if got := vkCallsPreflightPauseForError(errors.New("INVALID_JOIN_LINK")); got != 0 {
|
||||
t.Fatalf("terminal pause = %v, want 0", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestExtractVKCallsValues(t *testing.T) {
|
||||
resp := map[string]interface{}{
|
||||
"response": map[string]interface{}{
|
||||
|
||||
Reference in new issue
Block a user