MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / test_missing_length_iter

Method test_missing_length_iter

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

Source from the content-addressed store, hash-verified

419 self.assertEqual("iso-8859-1", (self.fs.get(oid)).encoding)
420
421 def test_missing_length_iter(self):
422 # Test fix that guards against PHP-237
423 self.fs.put(b"", filename="empty")
424 doc = self.db.fs.files.find_one({"filename": "empty"})
425 assert doc is not None
426 doc.pop("length")
427 self.db.fs.files.replace_one({"_id": doc["_id"]}, doc)
428 f = self.fs.get_last_version(filename="empty")
429
430 def iterate_file(grid_file):
431 for _chunk in grid_file:
432 pass
433 return True
434
435 self.assertTrue(iterate_file(f))
436
437 def test_gridfs_lazy_connect(self):
438 client = self.single_client("badhost", connect=False, serverSelectionTimeoutMS=10)

Callers

nothing calls this directly

Calls 5

putMethod · 0.45
find_oneMethod · 0.45
popMethod · 0.45
replace_oneMethod · 0.45
get_last_versionMethod · 0.45

Tested by

no test coverage detected