9
9
10
10
from openai import OpenAI , AsyncOpenAI
11
11
from tests .utils import assert_matches_type
12
- from openai .pagination import SyncPage , AsyncPage
12
+ from openai .pagination import SyncPage , AsyncPage , SyncCursorPage , AsyncCursorPage
13
13
from openai .types .fine_tuning .checkpoints import (
14
14
PermissionCreateResponse ,
15
15
PermissionDeleteResponse ,
@@ -71,7 +71,7 @@ def test_method_retrieve(self, client: OpenAI) -> None:
71
71
permission = client .fine_tuning .checkpoints .permissions .retrieve (
72
72
fine_tuned_model_checkpoint = "ft-AF1WoRqd3aJAHsqc9NY7iL8F" ,
73
73
)
74
- assert_matches_type (PermissionRetrieveResponse , permission , path = ["response" ])
74
+ assert_matches_type (SyncCursorPage [ PermissionRetrieveResponse ] , permission , path = ["response" ])
75
75
76
76
@parametrize
77
77
def test_method_retrieve_with_all_params (self , client : OpenAI ) -> None :
@@ -82,7 +82,7 @@ def test_method_retrieve_with_all_params(self, client: OpenAI) -> None:
82
82
order = "ascending" ,
83
83
project_id = "project_id" ,
84
84
)
85
- assert_matches_type (PermissionRetrieveResponse , permission , path = ["response" ])
85
+ assert_matches_type (SyncCursorPage [ PermissionRetrieveResponse ] , permission , path = ["response" ])
86
86
87
87
@parametrize
88
88
def test_raw_response_retrieve (self , client : OpenAI ) -> None :
@@ -93,7 +93,7 @@ def test_raw_response_retrieve(self, client: OpenAI) -> None:
93
93
assert response .is_closed is True
94
94
assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
95
95
permission = response .parse ()
96
- assert_matches_type (PermissionRetrieveResponse , permission , path = ["response" ])
96
+ assert_matches_type (SyncCursorPage [ PermissionRetrieveResponse ] , permission , path = ["response" ])
97
97
98
98
@parametrize
99
99
def test_streaming_response_retrieve (self , client : OpenAI ) -> None :
@@ -104,7 +104,7 @@ def test_streaming_response_retrieve(self, client: OpenAI) -> None:
104
104
assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
105
105
106
106
permission = response .parse ()
107
- assert_matches_type (PermissionRetrieveResponse , permission , path = ["response" ])
107
+ assert_matches_type (SyncCursorPage [ PermissionRetrieveResponse ] , permission , path = ["response" ])
108
108
109
109
assert cast (Any , response .is_closed ) is True
110
110
@@ -220,7 +220,7 @@ async def test_method_retrieve(self, async_client: AsyncOpenAI) -> None:
220
220
permission = await async_client .fine_tuning .checkpoints .permissions .retrieve (
221
221
fine_tuned_model_checkpoint = "ft-AF1WoRqd3aJAHsqc9NY7iL8F" ,
222
222
)
223
- assert_matches_type (PermissionRetrieveResponse , permission , path = ["response" ])
223
+ assert_matches_type (AsyncCursorPage [ PermissionRetrieveResponse ] , permission , path = ["response" ])
224
224
225
225
@parametrize
226
226
async def test_method_retrieve_with_all_params (self , async_client : AsyncOpenAI ) -> None :
@@ -231,7 +231,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncOpenAI)
231
231
order = "ascending" ,
232
232
project_id = "project_id" ,
233
233
)
234
- assert_matches_type (PermissionRetrieveResponse , permission , path = ["response" ])
234
+ assert_matches_type (AsyncCursorPage [ PermissionRetrieveResponse ] , permission , path = ["response" ])
235
235
236
236
@parametrize
237
237
async def test_raw_response_retrieve (self , async_client : AsyncOpenAI ) -> None :
@@ -242,7 +242,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncOpenAI) -> None:
242
242
assert response .is_closed is True
243
243
assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
244
244
permission = response .parse ()
245
- assert_matches_type (PermissionRetrieveResponse , permission , path = ["response" ])
245
+ assert_matches_type (AsyncCursorPage [ PermissionRetrieveResponse ] , permission , path = ["response" ])
246
246
247
247
@parametrize
248
248
async def test_streaming_response_retrieve (self , async_client : AsyncOpenAI ) -> None :
@@ -253,7 +253,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncOpenAI) -> N
253
253
assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
254
254
255
255
permission = await response .parse ()
256
- assert_matches_type (PermissionRetrieveResponse , permission , path = ["response" ])
256
+ assert_matches_type (AsyncCursorPage [ PermissionRetrieveResponse ] , permission , path = ["response" ])
257
257
258
258
assert cast (Any , response .is_closed ) is True
259
259
0 commit comments