⚡ fix(webdav): 改用独立分片流式合并并隔离测试协议

This commit is contained in:
orion committed 2026-09-18 15:38:45 +08:00
1 parent 9a489297f4
commit 90089f793e
7 files changed
+255 -64

No files matched your search

+12 -1
View File
@@ -15,7 +15,7 @@ from core.settings import settings
from tests.helpers import init_memory_db, close_db
class WebDAVOffsetTests(unittest.IsolatedAsyncioTestCase):
class WebDAVFixture(unittest.IsolatedAsyncioTestCase):
async def asyncSetUp(self):
self.original = dict(settings.user_config)
await init_memory_db()
@@ -96,6 +96,17 @@ class WebDAVOffsetTests(unittest.IsolatedAsyncioTestCase):
for i in range(3):self.assertEqual((await self.chunk(uid,i)).status_code,200)
return uid
class WebDAVOffsetTests(WebDAVFixture):
async def asyncSetUp(self):
await super().asyncSetUp()
from core.storage import WebDAVFileStorage
self.mode_patch = patch.object(WebDAVFileStorage, 'chunk_upload_mode', WebDAVFileStorage.offset_upload_mode)
self.mode_patch.start()
async def asyncTearDown(self):
self.mode_patch.stop()
await super().asyncTearDown()
async def test_offset_upload_resume_retry_and_no_local_merge(self):
uid=await self.init()
self.assertEqual((await UploadChunk.get(upload_id=uid,chunk_index=-1)).storage_mode,'webdav-offset')