(self)
| 348 | self.assertEqual(b"from stream with custom id", (self.fs.open_download_stream(oid)).read()) |
| 349 | |
| 350 | def test_missing_length_iter(self): |
| 351 | # Test fix that guards against PHP-237 |
| 352 | self.fs.upload_from_stream("empty", b"") |
| 353 | doc = self.db.fs.files.find_one({"filename": "empty"}) |
| 354 | assert doc is not None |
| 355 | doc.pop("length") |
| 356 | self.db.fs.files.replace_one({"_id": doc["_id"]}, doc) |
| 357 | fstr = self.fs.open_download_stream_by_name("empty") |
| 358 | |
| 359 | def iterate_file(grid_file): |
| 360 | for _ in grid_file: |
| 361 | pass |
| 362 | return True |
| 363 | |
| 364 | self.assertTrue(iterate_file(fstr)) |
| 365 | |
| 366 | def test_gridfs_lazy_connect(self): |
| 367 | client = self.single_client("badhost", connect=False, serverSelectionTimeoutMS=0) |
nothing calls this directly
no test coverage detected