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

Method collection_write_ops

test/test_session.py:374–397  ·  view source on GitHub ↗

Generate database write ops for tests.

(coll)

Source from the content-addressed store, hash-verified

372
373 @staticmethod
374 def collection_write_ops(coll):
375 """Generate database write ops for tests."""
376 return [
377 (coll.drop, [], {}),
378 (coll.bulk_write, [[InsertOne({})]], {}),
379 (coll.insert_one, [{}], {}),
380 (coll.insert_many, [[{}, {}]], {}),
381 (coll.replace_one, [{}, {}], {}),
382 (coll.update_one, [{}, {"$set": {"a": 1}}], {}),
383 (coll.update_many, [{}, {"$set": {"a": 1}}], {}),
384 (coll.delete_one, [{}], {}),
385 (coll.delete_many, [{}], {}),
386 (coll.find_one_and_replace, [{}, {}], {}),
387 (coll.find_one_and_update, [{}, {"$set": {"a": 1}}], {}),
388 (coll.find_one_and_delete, [{}, {}], {}),
389 (coll.rename, ["collection2"], {}),
390 # Drop collection2 between tests of "rename", above.
391 (coll.database.drop_collection, ["collection2"], {}),
392 (coll.create_indexes, [[IndexModel("a")]], {}),
393 (coll.create_index, ["a"], {}),
394 (coll.drop_index, ["a_1"], {}),
395 (coll.drop_indexes, [], {}),
396 (coll.aggregate, [[{"$out": "aggout"}]], {}),
397 ]
398
399 def test_collection(self):
400 client = self.client

Callers 2

test_collectionMethod · 0.95

Calls 2

InsertOneClass · 0.90
IndexModelClass · 0.90

Tested by

no test coverage detected