Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
| import pathlib | |
| ROOT=pathlib.Path(__file__).resolve().parents[1] | |
| def test_version_420(): | |
| assert (ROOT/'VERSION').read_text(encoding='utf-8').strip()=='4.6.20' | |
| def test_manifest_has_filename_and_sizes(): | |
| svc=(ROOT/"services"/"ocean_batch.py").read_text(encoding="utf-8") | |
| assert '"filename"' in svc | |
| assert '"size_bytes"' in svc | |
| assert '"known_size_bytes"' in svc | |
| assert '"known_size_file_count"' in svc | |
| def test_frontend_has_one_click_batch_download(): | |
| js=(ROOT/"static"/"js"/"app.js").read_text(encoding="utf-8") | |
| assert "function startOceanBatchDownloadAll" in js | |
| assert "function runOceanBatchDownloadQueue" in js | |
| assert "function waitManagedDownloadStatus" in js | |
| assert "打包 ZIP 下载" in js and "逐个下载" in js | |
| assert "查看文件" in js | |
| def test_batch_download_uses_managed_range_jobs(): | |
| js=(ROOT/"static"/"js"/"app.js").read_text(encoding="utf-8") | |
| assert 'j("/api/download/jobs"' in js | |
| assert "triggerBrowserSave(job.stream_url" in js | |
| assert "resume_supported" in js | |
| assert "30 秒无新字节" in js | |
| def test_queue_persists_across_page_refresh(): | |
| js=(ROOT/"static"/"js"/"app.js").read_text(encoding="utf-8") | |
| assert "ocean_batch_download_queue:" in js | |
| assert "restoreOceanBatchDownloadQueue" in js | |
| assert "localStorage.setItem" in js | |
| def test_batch_download_css(): | |
| css=(ROOT/"static"/"css"/"app.css").read_text(encoding="utf-8") | |
| assert ".ocean-batch-download-queue" in css | |
| assert ".ocean-batch-file-list" in css | |