| 162 | self.assertNotIn("md5", raw) |
| 163 | |
| 164 | async def test_corrupt_chunk(self): |
| 165 | files_id = await self.fs.put(b"foobar") |
| 166 | await self.db.fs.chunks.update_one( |
| 167 | {"files_id": files_id}, {"$set": {"data": Binary(b"foo", 0)}} |
| 168 | ) |
| 169 | try: |
| 170 | out = await self.fs.get(files_id) |
| 171 | with self.assertRaises(CorruptGridFile): |
| 172 | await out.read() |
| 173 | |
| 174 | out = await self.fs.get(files_id) |
| 175 | with self.assertRaises(CorruptGridFile): |
| 176 | await out.readline() |
| 177 | finally: |
| 178 | await self.fs.delete(files_id) |
| 179 | |
| 180 | async def test_put_ensures_index(self): |
| 181 | chunks = self.db.fs.chunks |