Skip to content

Commit 729ec4c

Browse files
chore(internal): update client tests (#104)
1 parent 3bdc140 commit 729ec4c

File tree

1 file changed

+30
-16
lines changed

1 file changed

+30
-16
lines changed

tests/test_client.py

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@
2323

2424
from lumaai import LumaAI, AsyncLumaAI, APIResponseValidationError
2525
from lumaai._types import Omit
26+
from lumaai._utils import maybe_transform
2627
from lumaai._models import BaseModel, FinalRequestOptions
2728
from lumaai._constants import RAW_RESPONSE_HEADER
2829
from lumaai._exceptions import LumaAIError, APIStatusError, APITimeoutError, APIResponseValidationError
2930
from lumaai._base_client import DEFAULT_TIMEOUT, HTTPX_DEFAULT_TIMEOUT, BaseClient, make_request_options
31+
from lumaai.types.generation_create_params import GenerationCreateParams
3032

3133
from .utils import update_env
3234

@@ -727,10 +729,13 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> No
727729
"/generations",
728730
body=cast(
729731
object,
730-
dict(
731-
aspect_ratio="16:9",
732-
loop=False,
733-
prompt="A teddy bear in sunglasses playing electric guitar, dancing and headbanging in the jungle in front of a large beautiful waterfall",
732+
maybe_transform(
733+
dict(
734+
aspect_ratio="16:9",
735+
loop=False,
736+
prompt="A teddy bear in sunglasses playing electric guitar, dancing and headbanging in the jungle in front of a large beautiful waterfall",
737+
),
738+
GenerationCreateParams,
734739
),
735740
),
736741
cast_to=httpx.Response,
@@ -749,10 +754,13 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> Non
749754
"/generations",
750755
body=cast(
751756
object,
752-
dict(
753-
aspect_ratio="16:9",
754-
loop=False,
755-
prompt="A teddy bear in sunglasses playing electric guitar, dancing and headbanging in the jungle in front of a large beautiful waterfall",
757+
maybe_transform(
758+
dict(
759+
aspect_ratio="16:9",
760+
loop=False,
761+
prompt="A teddy bear in sunglasses playing electric guitar, dancing and headbanging in the jungle in front of a large beautiful waterfall",
762+
),
763+
GenerationCreateParams,
756764
),
757765
),
758766
cast_to=httpx.Response,
@@ -1520,10 +1528,13 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter)
15201528
"/generations",
15211529
body=cast(
15221530
object,
1523-
dict(
1524-
aspect_ratio="16:9",
1525-
loop=False,
1526-
prompt="A teddy bear in sunglasses playing electric guitar, dancing and headbanging in the jungle in front of a large beautiful waterfall",
1531+
maybe_transform(
1532+
dict(
1533+
aspect_ratio="16:9",
1534+
loop=False,
1535+
prompt="A teddy bear in sunglasses playing electric guitar, dancing and headbanging in the jungle in front of a large beautiful waterfall",
1536+
),
1537+
GenerationCreateParams,
15271538
),
15281539
),
15291540
cast_to=httpx.Response,
@@ -1542,10 +1553,13 @@ async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter)
15421553
"/generations",
15431554
body=cast(
15441555
object,
1545-
dict(
1546-
aspect_ratio="16:9",
1547-
loop=False,
1548-
prompt="A teddy bear in sunglasses playing electric guitar, dancing and headbanging in the jungle in front of a large beautiful waterfall",
1556+
maybe_transform(
1557+
dict(
1558+
aspect_ratio="16:9",
1559+
loop=False,
1560+
prompt="A teddy bear in sunglasses playing electric guitar, dancing and headbanging in the jungle in front of a large beautiful waterfall",
1561+
),
1562+
GenerationCreateParams,
15491563
),
15501564
),
15511565
cast_to=httpx.Response,

0 commit comments

Comments
 (0)