(self)
| 248 | self.assertEqual(2, result.deleted_count) |
| 249 | |
| 250 | def test_remove_one(self): |
| 251 | # Test removing one document, empty selector. |
| 252 | self.coll.insert_many([{}, {}]) |
| 253 | expected = { |
| 254 | "nMatched": 0, |
| 255 | "nModified": 0, |
| 256 | "nUpserted": 0, |
| 257 | "nInserted": 0, |
| 258 | "nRemoved": 1, |
| 259 | "upserted": [], |
| 260 | "writeErrors": [], |
| 261 | "writeConcernErrors": [], |
| 262 | } |
| 263 | |
| 264 | result = self.coll.bulk_write([DeleteOne({})]) |
| 265 | self.assertEqualResponse(expected, result.bulk_api_result) |
| 266 | self.assertEqual(1, result.deleted_count) |
| 267 | self.assertEqual(self.coll.count_documents({}), 1) |
| 268 | |
| 269 | def test_upsert(self): |
| 270 | expected = { |
nothing calls this directly
no test coverage detected