Generate database write ops for tests.
(coll)
| 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 |
no test coverage detected