47
47
48
48
class TestClientBulkWrite (AsyncIntegrationTest ):
49
49
@async_client_context .require_version_min (8 , 0 , 0 , - 24 )
50
+ @async_client_context .require_no_serverless
50
51
async def test_returns_error_if_no_namespace_provided (self ):
51
52
models = [InsertOne (document = {"a" : "b" })]
52
53
with self .assertRaises (InvalidOperation ) as context :
@@ -57,6 +58,7 @@ async def test_returns_error_if_no_namespace_provided(self):
57
58
)
58
59
59
60
@async_client_context .require_version_min (8 , 0 , 0 , - 24 )
61
+ @async_client_context .require_no_serverless
60
62
async def test_handles_non_pymongo_error (self ):
61
63
with patch .object (
62
64
_AsyncClientBulk , "write_command" , return_value = {"error" : TypeError ("mock type error" )}
@@ -68,6 +70,7 @@ async def test_handles_non_pymongo_error(self):
68
70
self .assertFalse (hasattr (context .exception .error , "details" ))
69
71
70
72
@async_client_context .require_version_min (8 , 0 , 0 , - 24 )
73
+ @async_client_context .require_no_serverless
71
74
async def test_formats_write_error_correctly (self ):
72
75
models = [
73
76
InsertOne (namespace = "db.coll" , document = {"_id" : 1 }),
@@ -90,6 +93,7 @@ async def asyncSetUp(self):
90
93
self .max_message_size_bytes = await async_client_context .max_message_size_bytes
91
94
92
95
@async_client_context .require_version_min (8 , 0 , 0 , - 24 )
96
+ @async_client_context .require_no_serverless
93
97
async def test_batch_splits_if_num_operations_too_large (self ):
94
98
listener = OvertCommandListener ()
95
99
client = await async_rs_or_single_client (event_listeners = [listener ])
@@ -115,6 +119,7 @@ async def test_batch_splits_if_num_operations_too_large(self):
115
119
self .assertEqual (first_event .operation_id , second_event .operation_id )
116
120
117
121
@async_client_context .require_version_min (8 , 0 , 0 , - 24 )
122
+ @async_client_context .require_no_serverless
118
123
async def test_batch_splits_if_ops_payload_too_large (self ):
119
124
listener = OvertCommandListener ()
120
125
client = await async_rs_or_single_client (event_listeners = [listener ])
@@ -147,6 +152,7 @@ async def test_batch_splits_if_ops_payload_too_large(self):
147
152
self .assertEqual (first_event .operation_id , second_event .operation_id )
148
153
149
154
@async_client_context .require_version_min (8 , 0 , 0 , - 24 )
155
+ @async_client_context .require_no_serverless
150
156
@async_client_context .require_failCommand_fail_point
151
157
async def test_collects_write_concern_errors_across_batches (self ):
152
158
listener = OvertCommandListener ()
@@ -190,6 +196,7 @@ async def test_collects_write_concern_errors_across_batches(self):
190
196
self .assertEqual (len (bulk_write_events ), 2 )
191
197
192
198
@async_client_context .require_version_min (8 , 0 , 0 , - 24 )
199
+ @async_client_context .require_no_serverless
193
200
async def test_collects_write_errors_across_batches_unordered (self ):
194
201
listener = OvertCommandListener ()
195
202
client = await async_rs_or_single_client (event_listeners = [listener ])
@@ -220,6 +227,7 @@ async def test_collects_write_errors_across_batches_unordered(self):
220
227
self .assertEqual (len (bulk_write_events ), 2 )
221
228
222
229
@async_client_context .require_version_min (8 , 0 , 0 , - 24 )
230
+ @async_client_context .require_no_serverless
223
231
async def test_collects_write_errors_across_batches_ordered (self ):
224
232
listener = OvertCommandListener ()
225
233
client = await async_rs_or_single_client (event_listeners = [listener ])
@@ -250,6 +258,7 @@ async def test_collects_write_errors_across_batches_ordered(self):
250
258
self .assertEqual (len (bulk_write_events ), 1 )
251
259
252
260
@async_client_context .require_version_min (8 , 0 , 0 , - 24 )
261
+ @async_client_context .require_no_serverless
253
262
async def test_handles_cursor_requiring_getMore (self ):
254
263
listener = OvertCommandListener ()
255
264
client = await async_rs_or_single_client (event_listeners = [listener ])
@@ -290,6 +299,7 @@ async def test_handles_cursor_requiring_getMore(self):
290
299
self .assertTrue (get_more_event )
291
300
292
301
@async_client_context .require_version_min (8 , 0 , 0 , - 24 )
302
+ @async_client_context .require_no_serverless
293
303
@async_client_context .require_no_standalone
294
304
async def test_handles_cursor_requiring_getMore_within_transaction (self ):
295
305
listener = OvertCommandListener ()
@@ -333,6 +343,7 @@ async def test_handles_cursor_requiring_getMore_within_transaction(self):
333
343
self .assertTrue (get_more_event )
334
344
335
345
@async_client_context .require_version_min (8 , 0 , 0 , - 24 )
346
+ @async_client_context .require_no_serverless
336
347
@async_client_context .require_failCommand_fail_point
337
348
async def test_handles_getMore_error (self ):
338
349
listener = OvertCommandListener ()
@@ -388,6 +399,7 @@ async def test_handles_getMore_error(self):
388
399
self .assertTrue (kill_cursors_event )
389
400
390
401
@async_client_context .require_version_min (8 , 0 , 0 , - 24 )
402
+ @async_client_context .require_no_serverless
391
403
async def test_returns_error_if_unacknowledged_too_large_insert (self ):
392
404
listener = OvertCommandListener ()
393
405
client = await async_rs_or_single_client (event_listeners = [listener ])
@@ -444,6 +456,7 @@ async def _setup_namespace_test_models(self):
444
456
return num_models , models
445
457
446
458
@async_client_context .require_version_min (8 , 0 , 0 , - 24 )
459
+ @async_client_context .require_no_serverless
447
460
async def test_no_batch_splits_if_new_namespace_is_not_too_large (self ):
448
461
listener = OvertCommandListener ()
449
462
client = await async_rs_or_single_client (event_listeners = [listener ])
@@ -475,6 +488,7 @@ async def test_no_batch_splits_if_new_namespace_is_not_too_large(self):
475
488
self .assertEqual (event .command ["nsInfo" ][0 ]["ns" ], "db.coll" )
476
489
477
490
@async_client_context .require_version_min (8 , 0 , 0 , - 24 )
491
+ @async_client_context .require_no_serverless
478
492
async def test_batch_splits_if_new_namespace_is_too_large (self ):
479
493
listener = OvertCommandListener ()
480
494
client = await async_rs_or_single_client (event_listeners = [listener ])
@@ -513,6 +527,7 @@ async def test_batch_splits_if_new_namespace_is_too_large(self):
513
527
self .assertEqual (second_event .command ["nsInfo" ][0 ]["ns" ], namespace )
514
528
515
529
@async_client_context .require_version_min (8 , 0 , 0 , - 24 )
530
+ @async_client_context .require_no_serverless
516
531
async def test_returns_error_if_no_writes_can_be_added_to_ops (self ):
517
532
client = await async_rs_or_single_client ()
518
533
self .addAsyncCleanup (client .close )
@@ -531,6 +546,7 @@ async def test_returns_error_if_no_writes_can_be_added_to_ops(self):
531
546
await client .bulk_write (models = models )
532
547
533
548
@async_client_context .require_version_min (8 , 0 , 0 , - 24 )
549
+ @async_client_context .require_no_serverless
534
550
@unittest .skipUnless (_HAVE_PYMONGOCRYPT , "pymongocrypt is not installed" )
535
551
async def test_returns_error_if_auto_encryption_configured (self ):
536
552
opts = AutoEncryptionOpts (
@@ -556,6 +572,7 @@ async def asyncSetUp(self):
556
572
self .max_message_size_bytes = await async_client_context .max_message_size_bytes
557
573
558
574
@async_client_context .require_version_min (8 , 0 , 0 , - 24 )
575
+ @async_client_context .require_no_serverless
559
576
@async_client_context .require_failCommand_fail_point
560
577
async def test_timeout_in_multi_batch_bulk_write (self ):
561
578
_OVERHEAD = 500
0 commit comments