(self)
| 230 | self.assertIn(result.modified_count, (1, None)) |
| 231 | |
| 232 | def test_remove(self): |
| 233 | # Test removing all documents, ordered. |
| 234 | expected = { |
| 235 | "nMatched": 0, |
| 236 | "nModified": 0, |
| 237 | "nUpserted": 0, |
| 238 | "nInserted": 0, |
| 239 | "nRemoved": 2, |
| 240 | "upserted": [], |
| 241 | "writeErrors": [], |
| 242 | "writeConcernErrors": [], |
| 243 | } |
| 244 | self.coll.insert_many([{}, {}]) |
| 245 | |
| 246 | result = self.coll.bulk_write([DeleteMany({})]) |
| 247 | self.assertEqualResponse(expected, result.bulk_api_result) |
| 248 | self.assertEqual(2, result.deleted_count) |
| 249 | |
| 250 | def test_remove_one(self): |
| 251 | # Test removing one document, empty selector. |
nothing calls this directly
no test coverage detected