(self)
| 93 | ) |
| 94 | |
| 95 | async def test_basic(self): |
| 96 | oid = await self.fs.upload_from_stream("test_filename", b"hello world") |
| 97 | self.assertEqual(b"hello world", await (await self.fs.open_download_stream(oid)).read()) |
| 98 | self.assertEqual(1, await self.db.fs.files.count_documents({})) |
| 99 | self.assertEqual(1, await self.db.fs.chunks.count_documents({})) |
| 100 | |
| 101 | await self.fs.delete(oid) |
| 102 | with self.assertRaises(NoFile): |
| 103 | await self.fs.open_download_stream(oid) |
| 104 | self.assertEqual(0, await self.db.fs.files.count_documents({})) |
| 105 | self.assertEqual(0, await self.db.fs.chunks.count_documents({})) |
| 106 | |
| 107 | async def test_multi_chunk_delete(self): |
| 108 | self.assertEqual(0, await self.db.fs.files.count_documents({})) |
nothing calls this directly
no test coverage detected