(self)
| 348 | self.coll.bulk_write([{}]) # type: ignore[list-item] |
| 349 | |
| 350 | def test_upsert_large(self): |
| 351 | big = "a" * (client_context.max_bson_size - 37) |
| 352 | result = self.coll.bulk_write([UpdateOne({"x": 1}, {"$set": {"s": big}}, upsert=True)]) |
| 353 | self.assertEqualResponse( |
| 354 | { |
| 355 | "nMatched": 0, |
| 356 | "nModified": 0, |
| 357 | "nUpserted": 1, |
| 358 | "nInserted": 0, |
| 359 | "nRemoved": 0, |
| 360 | "upserted": [{"index": 0, "_id": "..."}], |
| 361 | }, |
| 362 | result.bulk_api_result, |
| 363 | ) |
| 364 | |
| 365 | self.assertEqual(1, self.coll.count_documents({"x": 1})) |
| 366 | |
| 367 | def test_client_generated_upsert_id(self): |
| 368 | result = self.coll.bulk_write( |
nothing calls this directly
no test coverage detected