99
1010from replicate import Replicate , AsyncReplicate
1111from tests .utils import assert_matches_type
12- from replicate .types import ModelListResponse
12+ from replicate .types import ModelGetResponse , ModelListResponse
1313from replicate .pagination import SyncCursorURLPage , AsyncCursorURLPage
1414
1515base_url = os .environ .get ("TEST_API_BASE_URL" , "http://127.0.0.1:4010" )
@@ -164,7 +164,7 @@ def test_method_get(self, client: Replicate) -> None:
164164 model_owner = "model_owner" ,
165165 model_name = "model_name" ,
166166 )
167- assert model is None
167+ assert_matches_type ( ModelGetResponse , model , path = [ "response" ])
168168
169169 @pytest .mark .skip ()
170170 @parametrize
@@ -177,7 +177,7 @@ def test_raw_response_get(self, client: Replicate) -> None:
177177 assert response .is_closed is True
178178 assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
179179 model = response .parse ()
180- assert model is None
180+ assert_matches_type ( ModelGetResponse , model , path = [ "response" ])
181181
182182 @pytest .mark .skip ()
183183 @parametrize
@@ -190,7 +190,7 @@ def test_streaming_response_get(self, client: Replicate) -> None:
190190 assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
191191
192192 model = response .parse ()
193- assert model is None
193+ assert_matches_type ( ModelGetResponse , model , path = [ "response" ])
194194
195195 assert cast (Any , response .is_closed ) is True
196196
@@ -215,7 +215,7 @@ def test_method_search(self, client: Replicate) -> None:
215215 model = client .models .search (
216216 body = "body" ,
217217 )
218- assert model is None
218+ assert_matches_type ( object , model , path = [ "response" ])
219219
220220 @pytest .mark .skip (reason = "Prism doesn't support query methods yet" )
221221 @parametrize
@@ -227,7 +227,7 @@ def test_raw_response_search(self, client: Replicate) -> None:
227227 assert response .is_closed is True
228228 assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
229229 model = response .parse ()
230- assert model is None
230+ assert_matches_type ( object , model , path = [ "response" ])
231231
232232 @pytest .mark .skip (reason = "Prism doesn't support query methods yet" )
233233 @parametrize
@@ -239,7 +239,7 @@ def test_streaming_response_search(self, client: Replicate) -> None:
239239 assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
240240
241241 model = response .parse ()
242- assert model is None
242+ assert_matches_type ( object , model , path = [ "response" ])
243243
244244 assert cast (Any , response .is_closed ) is True
245245
@@ -395,7 +395,7 @@ async def test_method_get(self, async_client: AsyncReplicate) -> None:
395395 model_owner = "model_owner" ,
396396 model_name = "model_name" ,
397397 )
398- assert model is None
398+ assert_matches_type ( ModelGetResponse , model , path = [ "response" ])
399399
400400 @pytest .mark .skip ()
401401 @parametrize
@@ -408,7 +408,7 @@ async def test_raw_response_get(self, async_client: AsyncReplicate) -> None:
408408 assert response .is_closed is True
409409 assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
410410 model = await response .parse ()
411- assert model is None
411+ assert_matches_type ( ModelGetResponse , model , path = [ "response" ])
412412
413413 @pytest .mark .skip ()
414414 @parametrize
@@ -421,7 +421,7 @@ async def test_streaming_response_get(self, async_client: AsyncReplicate) -> Non
421421 assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
422422
423423 model = await response .parse ()
424- assert model is None
424+ assert_matches_type ( ModelGetResponse , model , path = [ "response" ])
425425
426426 assert cast (Any , response .is_closed ) is True
427427
@@ -446,7 +446,7 @@ async def test_method_search(self, async_client: AsyncReplicate) -> None:
446446 model = await async_client .models .search (
447447 body = "body" ,
448448 )
449- assert model is None
449+ assert_matches_type ( object , model , path = [ "response" ])
450450
451451 @pytest .mark .skip (reason = "Prism doesn't support query methods yet" )
452452 @parametrize
@@ -458,7 +458,7 @@ async def test_raw_response_search(self, async_client: AsyncReplicate) -> None:
458458 assert response .is_closed is True
459459 assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
460460 model = await response .parse ()
461- assert model is None
461+ assert_matches_type ( object , model , path = [ "response" ])
462462
463463 @pytest .mark .skip (reason = "Prism doesn't support query methods yet" )
464464 @parametrize
@@ -470,6 +470,6 @@ async def test_streaming_response_search(self, async_client: AsyncReplicate) ->
470470 assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
471471
472472 model = await response .parse ()
473- assert model is None
473+ assert_matches_type ( object , model , path = [ "response" ])
474474
475475 assert cast (Any , response .is_closed ) is True
0 commit comments