From d93c9c8db6dd84d9c9528eb72b6b0ac9bb93a077 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 13 Feb 2025 04:39:15 +0000 Subject: [PATCH] chore(internal): update client tests --- tests/test_client.py | 46 +++++++++++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/tests/test_client.py b/tests/test_client.py index 9d57b3d..628a8c1 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -23,6 +23,7 @@ from runwayml import RunwayML, AsyncRunwayML, APIResponseValidationError from runwayml._types import Omit +from runwayml._utils import maybe_transform from runwayml._models import BaseModel, FinalRequestOptions from runwayml._constants import RAW_RESPONSE_HEADER from runwayml._exceptions import RunwayMLError, APIStatusError, APITimeoutError, APIResponseValidationError @@ -32,6 +33,7 @@ BaseClient, make_request_options, ) +from runwayml.types.image_to_video_create_params import ImageToVideoCreateParams from .utils import update_env @@ -719,10 +721,13 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> No "/v1/image_to_video", body=cast( object, - dict( - model="gen3a_turbo", - prompt_image="https://example.com/assets/bunny.jpg", - prompt_text="The bunny is eating a carrot", + maybe_transform( + dict( + model="gen3a_turbo", + prompt_image="https://example.com/assets/bunny.jpg", + prompt_text="The bunny is eating a carrot", + ), + ImageToVideoCreateParams, ), ), cast_to=httpx.Response, @@ -741,10 +746,13 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> Non "/v1/image_to_video", body=cast( object, - dict( - model="gen3a_turbo", - prompt_image="https://example.com/assets/bunny.jpg", - prompt_text="The bunny is eating a carrot", + maybe_transform( + dict( + model="gen3a_turbo", + prompt_image="https://example.com/assets/bunny.jpg", + prompt_text="The bunny is eating a carrot", + ), + ImageToVideoCreateParams, ), ), cast_to=httpx.Response, @@ -1515,10 +1523,13 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) "/v1/image_to_video", body=cast( object, - dict( - model="gen3a_turbo", - prompt_image="https://example.com/assets/bunny.jpg", - prompt_text="The bunny is eating a carrot", + maybe_transform( + dict( + model="gen3a_turbo", + prompt_image="https://example.com/assets/bunny.jpg", + prompt_text="The bunny is eating a carrot", + ), + ImageToVideoCreateParams, ), ), cast_to=httpx.Response, @@ -1537,10 +1548,13 @@ async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) "/v1/image_to_video", body=cast( object, - dict( - model="gen3a_turbo", - prompt_image="https://example.com/assets/bunny.jpg", - prompt_text="The bunny is eating a carrot", + maybe_transform( + dict( + model="gen3a_turbo", + prompt_image="https://example.com/assets/bunny.jpg", + prompt_text="The bunny is eating a carrot", + ), + ImageToVideoCreateParams, ), ), cast_to=httpx.Response,