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