| 477 | self.assertRaises(TypeError, self.fs.find, {}, {"_id": True}) |
| 478 | |
| 479 | def test_delete_not_initialized(self): |
| 480 | # Creating a cursor with invalid arguments will not run __init__ |
| 481 | # but will still call __del__. |
| 482 | cursor = GridOutCursor.__new__(GridOutCursor) # Skip calling __init__ |
| 483 | with self.assertRaises(TypeError): |
| 484 | cursor.__init__(self.db.fs.files, {}, {"_id": True}) # type: ignore |
| 485 | cursor.__del__() # no error |
| 486 | |
| 487 | def test_gridfs_find_one(self): |
| 488 | self.assertEqual(None, self.fs.find_one()) |