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

Method test_remove

test/test_bulk.py:232–248  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

230 self.assertIn(result.modified_count, (1, None))
231
232 def test_remove(self):
233 # Test removing all documents, ordered.
234 expected = {
235 "nMatched": 0,
236 "nModified": 0,
237 "nUpserted": 0,
238 "nInserted": 0,
239 "nRemoved": 2,
240 "upserted": [],
241 "writeErrors": [],
242 "writeConcernErrors": [],
243 }
244 self.coll.insert_many([{}, {}])
245
246 result = self.coll.bulk_write([DeleteMany({})])
247 self.assertEqualResponse(expected, result.bulk_api_result)
248 self.assertEqual(2, result.deleted_count)
249
250 def test_remove_one(self):
251 # Test removing one document, empty selector.

Callers

nothing calls this directly

Calls 4

DeleteManyClass · 0.85
insert_manyMethod · 0.45
bulk_writeMethod · 0.45
assertEqualResponseMethod · 0.45

Tested by

no test coverage detected