5
5
from unstructured_client import UnstructuredClient
6
6
from unstructured_client .models import shared , operations
7
7
from unstructured_client .models .errors import SDKError
8
- from unstructured_client .models .shared import DestinationConnectorType
9
-
10
8
11
9
12
10
def test_list_destinations (
@@ -19,7 +17,14 @@ def test_list_destinations(
19
17
headers = {"Content-Type" : "application/json" },
20
18
json = [
21
19
{
22
- "config" : {},
20
+ "config" : {
21
+ "remote_url" : "s3://mock-s3-connector" ,
22
+ "anonymous" : False ,
23
+ "key" : "**********" ,
24
+ "secret" : "**********" ,
25
+ "token" : None ,
26
+ "endpoint_url" : None ,
27
+ },
23
28
"created_at" : "2025-08-22T08:47:29.802Z" ,
24
29
"id" : "0c363dec-3c70-45ee-8041-481044a6e1cc" ,
25
30
"name" : "test_destination_name" ,
@@ -45,7 +50,7 @@ def test_list_destinations(
45
50
assert destination .id == "0c363dec-3c70-45ee-8041-481044a6e1cc"
46
51
assert destination .name == "test_destination_name"
47
52
assert destination .type == "s3"
48
- assert destination .config == {}
53
+ assert isinstance ( destination .config , shared . S3DestinationConnectorConfig )
49
54
assert destination .created_at == datetime .fromisoformat (
50
55
"2025-08-22T08:47:29.802+00:00"
51
56
)
@@ -115,7 +120,14 @@ def test_get_destination(httpx_mock, client: UnstructuredClient, platform_api_ur
115
120
method = "GET" ,
116
121
headers = {"Content-Type" : "application/json" },
117
122
json = {
118
- "config" : {},
123
+ "config" : {
124
+ "remote_url" : "s3://mock-s3-connector" ,
125
+ "anonymous" : False ,
126
+ "key" : "**********" ,
127
+ "secret" : "**********" ,
128
+ "token" : None ,
129
+ "endpoint_url" : None ,
130
+ },
119
131
"created_at" : "2025-08-22T08:47:29.802Z" ,
120
132
"id" : "0c363dec-3c70-45ee-8041-481044a6e1cc" ,
121
133
"name" : "test_destination_name" ,
@@ -139,7 +151,7 @@ def test_get_destination(httpx_mock, client: UnstructuredClient, platform_api_ur
139
151
assert destination .id == "0c363dec-3c70-45ee-8041-481044a6e1cc"
140
152
assert destination .name == "test_destination_name"
141
153
assert destination .type == "s3"
142
- assert destination .config == {}
154
+ assert isinstance ( destination .config , shared . S3DestinationConnectorConfig )
143
155
assert destination .created_at == datetime .fromisoformat (
144
156
"2025-08-22T08:47:29.802+00:00"
145
157
)
@@ -178,7 +190,12 @@ def test_create_destination(
178
190
method = "POST" ,
179
191
headers = {"Content-Type" : "application/json" },
180
192
json = {
181
- "config" : {},
193
+ "config" : {
194
+ "remote_url" : "s3://mock-s3-connector" ,
195
+ "key" : "blah" ,
196
+ "secret" : "blah" ,
197
+ "anonymous" : False ,
198
+ },
182
199
"created_at" : "2023-09-15T01:06:53.146Z" ,
183
200
"id" : "b25d4161-77a0-4e08-b65e-86f398ce15ad" ,
184
201
"name" : "test_destination_name" ,
@@ -191,8 +208,12 @@ def test_create_destination(
191
208
request = operations .CreateDestinationRequest (
192
209
create_destination_connector = shared .CreateDestinationConnector (
193
210
name = "test_destination_name" ,
194
- type = DestinationConnectorType .S3 ,
195
- config = {},
211
+ type = shared .DestinationConnectorType .S3 ,
212
+ config = {
213
+ "remote_url" : "s3://mock-s3-connector" ,
214
+ "key" : "blah" ,
215
+ "secret" : "blah" ,
216
+ },
196
217
)
197
218
)
198
219
)
@@ -208,7 +229,7 @@ def test_create_destination(
208
229
assert destination .id == "b25d4161-77a0-4e08-b65e-86f398ce15ad"
209
230
assert destination .name == "test_destination_name"
210
231
assert destination .type == "s3"
211
- assert destination .config == {}
232
+ assert isinstance ( destination .config , shared . S3DestinationConnectorConfig )
212
233
assert destination .created_at == datetime .fromisoformat (
213
234
"2023-09-15T01:06:53.146+00:00"
214
235
)
@@ -224,7 +245,12 @@ def test_update_destination(
224
245
method = "PUT" ,
225
246
headers = {"Content-Type" : "application/json" },
226
247
json = {
227
- "config" : {},
248
+ "config" : {
249
+ "remote_url" : "s3://mock-s3-connector" ,
250
+ "key" : "blah" ,
251
+ "secret" : "blah" ,
252
+ "anonymous" : False ,
253
+ },
228
254
"created_at" : "2023-09-15T01:06:53.146Z" ,
229
255
"id" : "b25d4161-77a0-4e08-b65e-86f398ce15ad" ,
230
256
"name" : "test_destination_name" ,
@@ -237,7 +263,11 @@ def test_update_destination(
237
263
request = operations .UpdateDestinationRequest (
238
264
destination_id = dest_id ,
239
265
update_destination_connector = shared .UpdateDestinationConnector (
240
- config = {}
266
+ config = {
267
+ "remote_url" : "s3://mock-s3-connector" ,
268
+ "key" : "blah" ,
269
+ "secret" : "blah" ,
270
+ },
241
271
),
242
272
)
243
273
)
@@ -254,7 +284,7 @@ def test_update_destination(
254
284
assert updated_destination .id == "b25d4161-77a0-4e08-b65e-86f398ce15ad"
255
285
assert updated_destination .name == "test_destination_name"
256
286
assert updated_destination .type == "s3"
257
- assert updated_destination .config == {}
287
+ assert isinstance ( updated_destination .config , shared . S3DestinationConnectorConfig )
258
288
assert updated_destination .created_at == datetime .fromisoformat (
259
289
"2023-09-15T01:06:53.146+00:00"
260
290
)
0 commit comments