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

Method test_error_code

test/test_collection.py:1303–1312  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1301 coll.insert_one({"_id": 1})
1302
1303 def test_error_code(self):
1304 try:
1305 self.db.test.update_many({}, {"$thismodifierdoesntexist": 1})
1306 except OperationFailure as exc:
1307 self.assertIn(exc.code, (9, 10147, 16840, 17009))
1308 # Just check that we set the error document. Fields
1309 # vary by MongoDB version.
1310 self.assertIsNotNone(exc.details)
1311 else:
1312 self.fail("OperationFailure was not raised")
1313
1314 def test_index_on_subfield(self):
1315 db = self.db

Callers

nothing calls this directly

Calls 1

update_manyMethod · 0.45

Tested by

no test coverage detected