Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 42 additions & 28 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

from arcadepy import Arcade, AsyncArcade, APIResponseValidationError
from arcadepy._types import Omit
from arcadepy._utils import maybe_transform
from arcadepy._models import BaseModel, FinalRequestOptions
from arcadepy._constants import RAW_RESPONSE_HEADER
from arcadepy._exceptions import ArcadeError, APIStatusError, APITimeoutError, APIResponseValidationError
Expand All @@ -32,6 +33,7 @@
BaseClient,
make_request_options,
)
from arcadepy.types.chat.completion_create_params import CompletionCreateParams

from .utils import update_env

Expand Down Expand Up @@ -717,13 +719,16 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> No
"/v1/chat/completions",
body=cast(
object,
dict(
messages=[
{
"role": "user",
"content": "Hello, how can I use Arcade AI?",
}
]
maybe_transform(
dict(
messages=[
{
"role": "user",
"content": "Hello, how can I use Arcade AI?",
}
]
),
CompletionCreateParams,
),
),
cast_to=httpx.Response,
Expand All @@ -742,13 +747,16 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> Non
"/v1/chat/completions",
body=cast(
object,
dict(
messages=[
{
"role": "user",
"content": "Hello, how can I use Arcade AI?",
}
]
maybe_transform(
dict(
messages=[
{
"role": "user",
"content": "Hello, how can I use Arcade AI?",
}
]
),
CompletionCreateParams,
),
),
cast_to=httpx.Response,
Expand Down Expand Up @@ -1513,13 +1521,16 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter)
"/v1/chat/completions",
body=cast(
object,
dict(
messages=[
{
"role": "user",
"content": "Hello, how can I use Arcade AI?",
}
]
maybe_transform(
dict(
messages=[
{
"role": "user",
"content": "Hello, how can I use Arcade AI?",
}
]
),
CompletionCreateParams,
),
),
cast_to=httpx.Response,
Expand All @@ -1538,13 +1549,16 @@ async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter)
"/v1/chat/completions",
body=cast(
object,
dict(
messages=[
{
"role": "user",
"content": "Hello, how can I use Arcade AI?",
}
]
maybe_transform(
dict(
messages=[
{
"role": "user",
"content": "Hello, how can I use Arcade AI?",
}
]
),
CompletionCreateParams,
),
),
cast_to=httpx.Response,
Expand Down