@@ -19,15 +19,15 @@ class TestGenerations:
19
19
20
20
@pytest .mark .skip (reason = "Prism tests are disabled" )
21
21
@parametrize
22
- def test_method_create (self , client : Gradient ) -> None :
22
+ def test_method_create_overload_1 (self , client : Gradient ) -> None :
23
23
generation = client .images .generations .create (
24
24
prompt = "A cute baby sea otter floating on its back in calm blue water" ,
25
25
)
26
26
assert_matches_type (GenerationCreateResponse , generation , path = ["response" ])
27
27
28
28
@pytest .mark .skip (reason = "Prism tests are disabled" )
29
29
@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 :
31
31
generation = client .images .generations .create (
32
32
prompt = "A cute baby sea otter floating on its back in calm blue water" ,
33
33
background = "auto" ,
@@ -46,7 +46,7 @@ def test_method_create_with_all_params(self, client: Gradient) -> None:
46
46
47
47
@pytest .mark .skip (reason = "Prism tests are disabled" )
48
48
@parametrize
49
- def test_raw_response_create (self , client : Gradient ) -> None :
49
+ def test_raw_response_create_overload_1 (self , client : Gradient ) -> None :
50
50
response = client .images .generations .with_raw_response .create (
51
51
prompt = "A cute baby sea otter floating on its back in calm blue water" ,
52
52
)
@@ -58,7 +58,7 @@ def test_raw_response_create(self, client: Gradient) -> None:
58
58
59
59
@pytest .mark .skip (reason = "Prism tests are disabled" )
60
60
@parametrize
61
- def test_streaming_response_create (self , client : Gradient ) -> None :
61
+ def test_streaming_response_create_overload_1 (self , client : Gradient ) -> None :
62
62
with client .images .generations .with_streaming_response .create (
63
63
prompt = "A cute baby sea otter floating on its back in calm blue water" ,
64
64
) as response :
@@ -70,6 +70,61 @@ def test_streaming_response_create(self, client: Gradient) -> None:
70
70
71
71
assert cast (Any , response .is_closed ) is True
72
72
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
+
73
128
74
129
class TestAsyncGenerations :
75
130
parametrize = pytest .mark .parametrize (
@@ -78,15 +133,15 @@ class TestAsyncGenerations:
78
133
79
134
@pytest .mark .skip (reason = "Prism tests are disabled" )
80
135
@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 :
82
137
generation = await async_client .images .generations .create (
83
138
prompt = "A cute baby sea otter floating on its back in calm blue water" ,
84
139
)
85
140
assert_matches_type (GenerationCreateResponse , generation , path = ["response" ])
86
141
87
142
@pytest .mark .skip (reason = "Prism tests are disabled" )
88
143
@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 :
90
145
generation = await async_client .images .generations .create (
91
146
prompt = "A cute baby sea otter floating on its back in calm blue water" ,
92
147
background = "auto" ,
@@ -105,7 +160,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGradient)
105
160
106
161
@pytest .mark .skip (reason = "Prism tests are disabled" )
107
162
@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 :
109
164
response = await async_client .images .generations .with_raw_response .create (
110
165
prompt = "A cute baby sea otter floating on its back in calm blue water" ,
111
166
)
@@ -117,7 +172,7 @@ async def test_raw_response_create(self, async_client: AsyncGradient) -> None:
117
172
118
173
@pytest .mark .skip (reason = "Prism tests are disabled" )
119
174
@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 :
121
176
async with async_client .images .generations .with_streaming_response .create (
122
177
prompt = "A cute baby sea otter floating on its back in calm blue water" ,
123
178
) as response :
@@ -128,3 +183,58 @@ async def test_streaming_response_create(self, async_client: AsyncGradient) -> N
128
183
assert_matches_type (GenerationCreateResponse , generation , path = ["response" ])
129
184
130
185
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