mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-20 10:02:54 +00:00
test(chatgpt): keep destination rejection assertions focused
Some checks failed
LiteLLM Rust / rust-lint (push) Has been cancelled
Terraform Modules / fmt, validate, test (aws) (push) Has been cancelled
Terraform Modules / fmt, validate, test (gcp) (push) Has been cancelled
LiteLLM Rust / rust-test (push) Has been cancelled
LiteLLM Rust / rust-wheel (push) Has been cancelled
Terraform Provider / gofmt, vet, build, test (push) Has been cancelled
Terraform Provider / Provider endpoints vs proxy OpenAPI schema (push) Has been cancelled
Some checks failed
LiteLLM Rust / rust-lint (push) Has been cancelled
Terraform Modules / fmt, validate, test (aws) (push) Has been cancelled
Terraform Modules / fmt, validate, test (gcp) (push) Has been cancelled
LiteLLM Rust / rust-test (push) Has been cancelled
LiteLLM Rust / rust-wheel (push) Has been cancelled
Terraform Provider / gofmt, vet, build, test (push) Has been cancelled
Terraform Provider / Provider endpoints vs proxy OpenAPI schema (push) Has been cancelled
This commit is contained in:
parent
2a23e4ce4b
commit
40b36735ba
1 changed files with 12 additions and 9 deletions
|
|
@ -441,17 +441,20 @@ async def test_client_login_cannot_be_redirected_to_another_host(
|
|||
**credential,
|
||||
}
|
||||
)
|
||||
async def request() -> None:
|
||||
if endpoint == "chat":
|
||||
if async_call:
|
||||
await litellm.acompletion(**params, messages=[{"role": "user", "content": "Hello"}])
|
||||
else:
|
||||
litellm.completion(**params, messages=[{"role": "user", "content": "Hello"}])
|
||||
elif async_call:
|
||||
await litellm.aresponses(**params, input="Hello")
|
||||
else:
|
||||
litellm.responses(**params, input="Hello")
|
||||
|
||||
with respx.mock as transport:
|
||||
with pytest.raises(litellm.BadRequestError, match="official HTTPS ChatGPT endpoint"):
|
||||
if endpoint == "chat":
|
||||
if async_call:
|
||||
await litellm.acompletion(**params, messages=[{"role": "user", "content": "Hello"}])
|
||||
else:
|
||||
litellm.completion(**params, messages=[{"role": "user", "content": "Hello"}])
|
||||
elif async_call:
|
||||
await litellm.aresponses(**params, input="Hello")
|
||||
else:
|
||||
litellm.responses(**params, input="Hello")
|
||||
await request()
|
||||
assert len(transport.calls) == 0
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue