Add projects
This commit is contained in:
parent
2d3a9ad623
commit
8b607dd700
1802 changed files with 503346 additions and 2 deletions
18
backend/sdk/cliproxy/auth/request_termination_test.go
Normal file
18
backend/sdk/cliproxy/auth/request_termination_test.go
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
package auth
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
cliproxyexecutor "github.com/router-for-me/CLIProxyAPI/v7/sdk/cliproxy/executor"
|
||||
)
|
||||
|
||||
func TestRequestTerminatedErrorSkipsCreditsFallback(t *testing.T) {
|
||||
errTerminated := &cliproxyexecutor.RequestTerminatedError{HTTPStatus: http.StatusTooManyRequests}
|
||||
if !isRequestTerminatedError(errTerminated) {
|
||||
t.Fatal("isRequestTerminatedError() = false")
|
||||
}
|
||||
if shouldAttemptAntigravityCreditsFallback(&Manager{}, errTerminated, []string{"antigravity"}) {
|
||||
t.Fatal("terminated request must not use Antigravity credits fallback")
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue