File tree Expand file tree Collapse file tree 2 files changed +16
-14
lines changed Expand file tree Collapse file tree 2 files changed +16
-14
lines changed Original file line number Diff line number Diff line change @@ -432,13 +432,14 @@ async def test_command_with_regex(self):
432
432
433
433
async def test_command_bulkWrite (self ):
434
434
# Ensure bulk write commands can be run directly via db.command().
435
- await self .client .admin .command (
436
- {
437
- "bulkWrite" : 1 ,
438
- "nsInfo" : [{"ns" : self .db .test .full_name }],
439
- "ops" : [{"insert" : 0 , "document" : {}}],
440
- }
441
- )
435
+ if async_client_context .version .at_least (8 , 0 ):
436
+ await self .client .admin .command (
437
+ {
438
+ "bulkWrite" : 1 ,
439
+ "nsInfo" : [{"ns" : self .db .test .full_name }],
440
+ "ops" : [{"insert" : 0 , "document" : {}}],
441
+ }
442
+ )
442
443
await self .db .command ({"insert" : "test" , "documents" : [{}]})
443
444
await self .db .command ({"update" : "test" , "updates" : [{"q" : {}, "u" : {"$set" : {"x" : 1 }}}]})
444
445
await self .db .command ({"delete" : "test" , "deletes" : [{"q" : {}, "limit" : 1 }]})
Original file line number Diff line number Diff line change @@ -427,13 +427,14 @@ def test_command_with_regex(self):
427
427
428
428
def test_command_bulkWrite (self ):
429
429
# Ensure bulk write commands can be run directly via db.command().
430
- self .client .admin .command (
431
- {
432
- "bulkWrite" : 1 ,
433
- "nsInfo" : [{"ns" : self .db .test .full_name }],
434
- "ops" : [{"insert" : 0 , "document" : {}}],
435
- }
436
- )
430
+ if client_context .version .at_least (8 , 0 ):
431
+ self .client .admin .command (
432
+ {
433
+ "bulkWrite" : 1 ,
434
+ "nsInfo" : [{"ns" : self .db .test .full_name }],
435
+ "ops" : [{"insert" : 0 , "document" : {}}],
436
+ }
437
+ )
437
438
self .db .command ({"insert" : "test" , "documents" : [{}]})
438
439
self .db .command ({"update" : "test" , "updates" : [{"q" : {}, "u" : {"$set" : {"x" : 1 }}}]})
439
440
self .db .command ({"delete" : "test" , "deletes" : [{"q" : {}, "limit" : 1 }]})
You can’t perform that action at this time.
0 commit comments