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

Method test_remove_one

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

Source from the content-addressed store, hash-verified

248 self.assertEqual(2, result.deleted_count)
249
250 def test_remove_one(self):
251 # Test removing one document, empty selector.
252 self.coll.insert_many([{}, {}])
253 expected = {
254 "nMatched": 0,
255 "nModified": 0,
256 "nUpserted": 0,
257 "nInserted": 0,
258 "nRemoved": 1,
259 "upserted": [],
260 "writeErrors": [],
261 "writeConcernErrors": [],
262 }
263
264 result = self.coll.bulk_write([DeleteOne({})])
265 self.assertEqualResponse(expected, result.bulk_api_result)
266 self.assertEqual(1, result.deleted_count)
267 self.assertEqual(self.coll.count_documents({}), 1)
268
269 def test_upsert(self):
270 expected = {

Callers

nothing calls this directly

Calls 5

DeleteOneClass · 0.85
insert_manyMethod · 0.45
bulk_writeMethod · 0.45
assertEqualResponseMethod · 0.45
count_documentsMethod · 0.45

Tested by

no test coverage detected