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

Method test_update

test/test_collation.py:182–195  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

180 self.assertEqual(self.collation.document, command["deletes"][0]["collation"])
181
182 def test_update(self):
183 self.db.test.replace_one({"foo": 42}, {"foo": 43}, collation=self.collation)
184 command = self.listener.started_events[0].command
185 self.assertEqual(self.collation.document, command["updates"][0]["collation"])
186
187 self.listener.reset()
188 self.db.test.update_one({"foo": 42}, {"$set": {"foo": 43}}, collation=self.collation)
189 command = self.listener.started_events[0].command
190 self.assertEqual(self.collation.document, command["updates"][0]["collation"])
191
192 self.listener.reset()
193 self.db.test.update_many({"foo": 42}, {"$set": {"foo": 43}}, collation=self.collation)
194 command = self.listener.started_events[0].command
195 self.assertEqual(self.collation.document, command["updates"][0]["collation"])
196
197 def test_find_and(self):
198 self.db.test.find_one_and_delete({"foo": 42}, collation=self.collation)

Callers

nothing calls this directly

Calls 4

replace_oneMethod · 0.45
resetMethod · 0.45
update_oneMethod · 0.45
update_manyMethod · 0.45

Tested by

no test coverage detected