@@ -19,15 +19,15 @@ class TestGenerations:
1919
2020 @pytest .mark .skip (reason = "Prism tests are disabled" )
2121 @parametrize
22- def test_method_create (self , client : Gradient ) -> None :
22+ def test_method_create_overload_1 (self , client : Gradient ) -> None :
2323 generation = client .images .generations .create (
2424 prompt = "A cute baby sea otter floating on its back in calm blue water" ,
2525 )
2626 assert_matches_type (GenerationCreateResponse , generation , path = ["response" ])
2727
2828 @pytest .mark .skip (reason = "Prism tests are disabled" )
2929 @parametrize
30- def test_method_create_with_all_params (self , client : Gradient ) -> None :
30+ def test_method_create_with_all_params_overload_1 (self , client : Gradient ) -> None :
3131 generation = client .images .generations .create (
3232 prompt = "A cute baby sea otter floating on its back in calm blue water" ,
3333 background = "auto" ,
@@ -46,7 +46,7 @@ def test_method_create_with_all_params(self, client: Gradient) -> None:
4646
4747 @pytest .mark .skip (reason = "Prism tests are disabled" )
4848 @parametrize
49- def test_raw_response_create (self , client : Gradient ) -> None :
49+ def test_raw_response_create_overload_1 (self , client : Gradient ) -> None :
5050 response = client .images .generations .with_raw_response .create (
5151 prompt = "A cute baby sea otter floating on its back in calm blue water" ,
5252 )
@@ -58,7 +58,7 @@ def test_raw_response_create(self, client: Gradient) -> None:
5858
5959 @pytest .mark .skip (reason = "Prism tests are disabled" )
6060 @parametrize
61- def test_streaming_response_create (self , client : Gradient ) -> None :
61+ def test_streaming_response_create_overload_1 (self , client : Gradient ) -> None :
6262 with client .images .generations .with_streaming_response .create (
6363 prompt = "A cute baby sea otter floating on its back in calm blue water" ,
6464 ) as response :
@@ -70,6 +70,61 @@ def test_streaming_response_create(self, client: Gradient) -> None:
7070
7171 assert cast (Any , response .is_closed ) is True
7272
73+ @pytest .mark .skip (reason = "Prism tests are disabled" )
74+ @parametrize
75+ def test_method_create_overload_2 (self , client : Gradient ) -> None :
76+ generation_stream = client .images .generations .create (
77+ prompt = "A cute baby sea otter floating on its back in calm blue water" ,
78+ stream = True ,
79+ )
80+ generation_stream .response .close ()
81+
82+ @pytest .mark .skip (reason = "Prism tests are disabled" )
83+ @parametrize
84+ def test_method_create_with_all_params_overload_2 (self , client : Gradient ) -> None :
85+ generation_stream = client .images .generations .create (
86+ prompt = "A cute baby sea otter floating on its back in calm blue water" ,
87+ stream = True ,
88+ background = "auto" ,
89+ model = "openai-gpt-image-1" ,
90+ moderation = "auto" ,
91+ n = 1 ,
92+ output_compression = 100 ,
93+ output_format = "png" ,
94+ partial_images = 1 ,
95+ quality = "auto" ,
96+ size = "auto" ,
97+ user = "user-1234" ,
98+ )
99+ generation_stream .response .close ()
100+
101+ @pytest .mark .skip (reason = "Prism tests are disabled" )
102+ @parametrize
103+ def test_raw_response_create_overload_2 (self , client : Gradient ) -> None :
104+ response = client .images .generations .with_raw_response .create (
105+ prompt = "A cute baby sea otter floating on its back in calm blue water" ,
106+ stream = True ,
107+ )
108+
109+ assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
110+ stream = response .parse ()
111+ stream .close ()
112+
113+ @pytest .mark .skip (reason = "Prism tests are disabled" )
114+ @parametrize
115+ def test_streaming_response_create_overload_2 (self , client : Gradient ) -> None :
116+ with client .images .generations .with_streaming_response .create (
117+ prompt = "A cute baby sea otter floating on its back in calm blue water" ,
118+ stream = True ,
119+ ) as response :
120+ assert not response .is_closed
121+ assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
122+
123+ stream = response .parse ()
124+ stream .close ()
125+
126+ assert cast (Any , response .is_closed ) is True
127+
73128
74129class TestAsyncGenerations :
75130 parametrize = pytest .mark .parametrize (
@@ -78,15 +133,15 @@ class TestAsyncGenerations:
78133
79134 @pytest .mark .skip (reason = "Prism tests are disabled" )
80135 @parametrize
81- async def test_method_create (self , async_client : AsyncGradient ) -> None :
136+ async def test_method_create_overload_1 (self , async_client : AsyncGradient ) -> None :
82137 generation = await async_client .images .generations .create (
83138 prompt = "A cute baby sea otter floating on its back in calm blue water" ,
84139 )
85140 assert_matches_type (GenerationCreateResponse , generation , path = ["response" ])
86141
87142 @pytest .mark .skip (reason = "Prism tests are disabled" )
88143 @parametrize
89- async def test_method_create_with_all_params (self , async_client : AsyncGradient ) -> None :
144+ async def test_method_create_with_all_params_overload_1 (self , async_client : AsyncGradient ) -> None :
90145 generation = await async_client .images .generations .create (
91146 prompt = "A cute baby sea otter floating on its back in calm blue water" ,
92147 background = "auto" ,
@@ -105,7 +160,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGradient)
105160
106161 @pytest .mark .skip (reason = "Prism tests are disabled" )
107162 @parametrize
108- async def test_raw_response_create (self , async_client : AsyncGradient ) -> None :
163+ async def test_raw_response_create_overload_1 (self , async_client : AsyncGradient ) -> None :
109164 response = await async_client .images .generations .with_raw_response .create (
110165 prompt = "A cute baby sea otter floating on its back in calm blue water" ,
111166 )
@@ -117,7 +172,7 @@ async def test_raw_response_create(self, async_client: AsyncGradient) -> None:
117172
118173 @pytest .mark .skip (reason = "Prism tests are disabled" )
119174 @parametrize
120- async def test_streaming_response_create (self , async_client : AsyncGradient ) -> None :
175+ async def test_streaming_response_create_overload_1 (self , async_client : AsyncGradient ) -> None :
121176 async with async_client .images .generations .with_streaming_response .create (
122177 prompt = "A cute baby sea otter floating on its back in calm blue water" ,
123178 ) as response :
@@ -128,3 +183,58 @@ async def test_streaming_response_create(self, async_client: AsyncGradient) -> N
128183 assert_matches_type (GenerationCreateResponse , generation , path = ["response" ])
129184
130185 assert cast (Any , response .is_closed ) is True
186+
187+ @pytest .mark .skip (reason = "Prism tests are disabled" )
188+ @parametrize
189+ async def test_method_create_overload_2 (self , async_client : AsyncGradient ) -> None :
190+ generation_stream = await async_client .images .generations .create (
191+ prompt = "A cute baby sea otter floating on its back in calm blue water" ,
192+ stream = True ,
193+ )
194+ await generation_stream .response .aclose ()
195+
196+ @pytest .mark .skip (reason = "Prism tests are disabled" )
197+ @parametrize
198+ async def test_method_create_with_all_params_overload_2 (self , async_client : AsyncGradient ) -> None :
199+ generation_stream = await async_client .images .generations .create (
200+ prompt = "A cute baby sea otter floating on its back in calm blue water" ,
201+ stream = True ,
202+ background = "auto" ,
203+ model = "openai-gpt-image-1" ,
204+ moderation = "auto" ,
205+ n = 1 ,
206+ output_compression = 100 ,
207+ output_format = "png" ,
208+ partial_images = 1 ,
209+ quality = "auto" ,
210+ size = "auto" ,
211+ user = "user-1234" ,
212+ )
213+ await generation_stream .response .aclose ()
214+
215+ @pytest .mark .skip (reason = "Prism tests are disabled" )
216+ @parametrize
217+ async def test_raw_response_create_overload_2 (self , async_client : AsyncGradient ) -> None :
218+ response = await async_client .images .generations .with_raw_response .create (
219+ prompt = "A cute baby sea otter floating on its back in calm blue water" ,
220+ stream = True ,
221+ )
222+
223+ assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
224+ stream = await response .parse ()
225+ await stream .close ()
226+
227+ @pytest .mark .skip (reason = "Prism tests are disabled" )
228+ @parametrize
229+ async def test_streaming_response_create_overload_2 (self , async_client : AsyncGradient ) -> None :
230+ async with async_client .images .generations .with_streaming_response .create (
231+ prompt = "A cute baby sea otter floating on its back in calm blue water" ,
232+ stream = True ,
233+ ) as response :
234+ assert not response .is_closed
235+ assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
236+
237+ stream = await response .parse ()
238+ await stream .close ()
239+
240+ assert cast (Any , response .is_closed ) is True
0 commit comments