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

Method test_insert

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

Source from the content-addressed store, hash-verified

128 self.coll.bulk_write([])
129
130 def test_insert(self):
131 expected = {
132 "nMatched": 0,
133 "nModified": 0,
134 "nUpserted": 0,
135 "nInserted": 1,
136 "nRemoved": 0,
137 "upserted": [],
138 "writeErrors": [],
139 "writeConcernErrors": [],
140 }
141
142 result = self.coll.bulk_write([InsertOne({})])
143 self.assertEqualResponse(expected, result.bulk_api_result)
144 self.assertEqual(1, result.inserted_count)
145 self.assertEqual(1, self.coll.count_documents({}))
146
147 def _test_update_many(self, update):
148 expected = {

Callers

nothing calls this directly

Calls 4

InsertOneClass · 0.85
bulk_writeMethod · 0.45
assertEqualResponseMethod · 0.45
count_documentsMethod · 0.45

Tested by

no test coverage detected