MCPcopy Create free account
hub / github.com/mongodb/mongo-python-driver / test_delete_not_initialized

Method test_delete_not_initialized

test/test_gridfs.py:479–485  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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())

Callers

nothing calls this directly

Calls 3

__new__Method · 0.45
__init__Method · 0.45
__del__Method · 0.45

Tested by

no test coverage detected