9
9
10
10
from finch import Finch , AsyncFinch
11
11
from tests .utils import assert_matches_type
12
- from finch .pagination import SyncPage , AsyncPage
13
- from finch .types .jobs import AutomatedAsyncJob , AutomatedCreateResponse
12
+ from finch .types .jobs import (
13
+ AutomatedAsyncJob ,
14
+ AutomatedListResponse ,
15
+ AutomatedCreateResponse ,
16
+ )
14
17
15
18
base_url = os .environ .get ("TEST_API_BASE_URL" , "http://127.0.0.1:4010" )
16
19
@@ -124,15 +127,15 @@ def test_path_params_retrieve(self, client: Finch) -> None:
124
127
@parametrize
125
128
def test_method_list (self , client : Finch ) -> None :
126
129
automated = client .jobs .automated .list ()
127
- assert_matches_type (SyncPage [ AutomatedAsyncJob ] , automated , path = ["response" ])
130
+ assert_matches_type (AutomatedListResponse , automated , path = ["response" ])
128
131
129
132
@parametrize
130
133
def test_method_list_with_all_params (self , client : Finch ) -> None :
131
134
automated = client .jobs .automated .list (
132
135
limit = 0 ,
133
136
offset = 0 ,
134
137
)
135
- assert_matches_type (SyncPage [ AutomatedAsyncJob ] , automated , path = ["response" ])
138
+ assert_matches_type (AutomatedListResponse , automated , path = ["response" ])
136
139
137
140
@parametrize
138
141
def test_raw_response_list (self , client : Finch ) -> None :
@@ -141,7 +144,7 @@ def test_raw_response_list(self, client: Finch) -> None:
141
144
assert response .is_closed is True
142
145
assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
143
146
automated = response .parse ()
144
- assert_matches_type (SyncPage [ AutomatedAsyncJob ] , automated , path = ["response" ])
147
+ assert_matches_type (AutomatedListResponse , automated , path = ["response" ])
145
148
146
149
@parametrize
147
150
def test_streaming_response_list (self , client : Finch ) -> None :
@@ -150,7 +153,7 @@ def test_streaming_response_list(self, client: Finch) -> None:
150
153
assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
151
154
152
155
automated = response .parse ()
153
- assert_matches_type (SyncPage [ AutomatedAsyncJob ] , automated , path = ["response" ])
156
+ assert_matches_type (AutomatedListResponse , automated , path = ["response" ])
154
157
155
158
assert cast (Any , response .is_closed ) is True
156
159
@@ -264,15 +267,15 @@ async def test_path_params_retrieve(self, async_client: AsyncFinch) -> None:
264
267
@parametrize
265
268
async def test_method_list (self , async_client : AsyncFinch ) -> None :
266
269
automated = await async_client .jobs .automated .list ()
267
- assert_matches_type (AsyncPage [ AutomatedAsyncJob ] , automated , path = ["response" ])
270
+ assert_matches_type (AutomatedListResponse , automated , path = ["response" ])
268
271
269
272
@parametrize
270
273
async def test_method_list_with_all_params (self , async_client : AsyncFinch ) -> None :
271
274
automated = await async_client .jobs .automated .list (
272
275
limit = 0 ,
273
276
offset = 0 ,
274
277
)
275
- assert_matches_type (AsyncPage [ AutomatedAsyncJob ] , automated , path = ["response" ])
278
+ assert_matches_type (AutomatedListResponse , automated , path = ["response" ])
276
279
277
280
@parametrize
278
281
async def test_raw_response_list (self , async_client : AsyncFinch ) -> None :
@@ -281,7 +284,7 @@ async def test_raw_response_list(self, async_client: AsyncFinch) -> None:
281
284
assert response .is_closed is True
282
285
assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
283
286
automated = response .parse ()
284
- assert_matches_type (AsyncPage [ AutomatedAsyncJob ] , automated , path = ["response" ])
287
+ assert_matches_type (AutomatedListResponse , automated , path = ["response" ])
285
288
286
289
@parametrize
287
290
async def test_streaming_response_list (self , async_client : AsyncFinch ) -> None :
@@ -290,6 +293,6 @@ async def test_streaming_response_list(self, async_client: AsyncFinch) -> None:
290
293
assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
291
294
292
295
automated = await response .parse ()
293
- assert_matches_type (AsyncPage [ AutomatedAsyncJob ] , automated , path = ["response" ])
296
+ assert_matches_type (AutomatedListResponse , automated , path = ["response" ])
294
297
295
298
assert cast (Any , response .is_closed ) is True
0 commit comments