MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / test_command_bulkWrite

Method test_command_bulkWrite

test/test_database.py:419–432  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

417 self.assertIsInstance(doc["r"], Regex)
418
419 def test_command_bulkWrite(self):
420 # Ensure bulk write commands can be run directly via db.command().
421 if client_context.version.at_least(8, 0):
422 self.client.admin.command(
423 {
424 "bulkWrite": 1,
425 "nsInfo": [{"ns": self.db.test.full_name}],
426 "ops": [{"insert": 0, "document": {}}],
427 }
428 )
429 self.db.command({"insert": "test", "documents": [{}]})
430 self.db.command({"update": "test", "updates": [{"q": {}, "u": {"$set": {"x": 1}}}]})
431 self.db.command({"delete": "test", "deletes": [{"q": {}, "limit": 1}]})
432 self.db.test.drop()
433
434 def test_cursor_command(self):
435 db = self.client.pymongo_test

Callers

nothing calls this directly

Calls 3

at_leastMethod · 0.80
commandMethod · 0.45
dropMethod · 0.45

Tested by

no test coverage detected