利用 AI 大模型和自动化工作流,根据主题或关键词一键生成高清短视频。Generate HD short videos from a topic or keyword with an automated AI workflow.
Python ai-video-generatorcontent-creationffmpeginstagram-reelsllmpythonshort-videosubtitlestext-to-speechtiktokvideo-automationvideo-workflowworkflow-automationyoutube-shorts
test(ci): expand regression coverage
harry0703b32b2cfe3b6d
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex c28c9b6b..28f75193 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -31,5 +31,10 @@ jobs:- name: Compile Python sourcesrun: uv run python -m compileall app cli.py main.py webui test- - name: Run deterministic unit tests- run: uv run python -X utf8 -m unittest test.services.test_state test.services.test_task test.services.test_schema test.services.test_video_effects test.services.test_bgm test.services.test_webui_bgm test.services.test_clip_speed test.services.test_webui_i18n+ - name: Run unit tests with coverage+ # pytest 兼容现有 unittest.TestCase,同时会收集仓库中的 pytest 风格+ # 测试,避免测试文件已存在但 CI 没有真正执行。+ run: uv run python -X utf8 -m coverage run -m pytest -q test++ - name: Report test coverage+ run: uv run python -m coverage reportdiff --git a/.gitignore b/.gitignoreindex e1575a0c..a997b7b2 100644--- a/.gitignore+++ b/.gitignore@@ -34,7 +34,11 @@ debug/debug_*.pytest_*.py!test/services/test_*.py+!test/test_*.pystreamlit.log+.coverage+coverage.xml+htmlcov/.codegraph/docs/superpowers.understand-anythingdiff --git a/app/controllers/manager/base_manager.py b/app/controllers/manager/base_manager.pyindex 34804798..ac5bf710 100644--- a/app/controllers/manager/base_manager.py+++ b/app/controllers/manager/base_manager.py@@ -25,7 +25,15 @@ class TaskManager:logger.info(f"add task: {func.__name__}, current_tasks: {self.current_tasks}")- self.execute_task(func, *args, **kwargs)+ # 在线程启动前先预占并发名额。原实现在线程内部递增,连续请求+ # 可能都在子线程获得锁之前看到 current_tasks=0,从而突破并发+ # 上限。启动失败时回滚名额,让后续请求仍可正常调度。+ self.current_tasks += 1+ try:+ self.execute_task(func, *args, **kwargs)+ except Exception:+ self.current_tasks -= 1+ raiseelse:queue_size = self.queue_size()# 并发数已满时才进入排队。队列必须有上限,否则匿名接口可以持续@@ -51,8 +59,6 @@ class TaskManager:def run_task(self, func: Callable, *args: Any, **kwargs: Any):try:- with self.lock:- self.current_tasks += 1func(*args, **kwargs) # call the function here, passing *args and **kwargs.finally:self.task_done()@@ -67,7 +73,15 @@ class TaskManager:func = task_info["func"]args = task_info.get("args", ())kwargs = task_info.get("kwargs", {})- self.execute_task(func, *args, **kwargs)+ # 与直接创建任务保持同一计数时机,避免刚出队的任务尚未在线程+ # 内计数时,又有新请求绕过队列占用同一个并发名额。+ self.current_tasks += 1+ try:+ self.execute_task(func, *args, **kwargs)+ except Exception:+ self.current_tasks -= 1+ self.enqueue(task_info)+ raisedef task_done(self):with self.lock:diff --git a/app/controllers/manager/redis_manager.py b/app/controllers/manager/redis_manager.pyindex 861af0f4..db108cc2 100644--- a/app/controllers/manager/redis_manager.py+++ b/app/controllers/manager/redis_manager.py@@ -28,13 +28,16 @@ class RedisTaskManager(TaskManager):def enqueue(self, task: Dict):task_with_serializable_params = task.copy()+ # task.copy() 只复制最外层字典;如果直接改写嵌套 kwargs,会把调用方+ # 持有的 VideoParams 同步替换成 dict。后续日志或重试仍可能读取原任务,+ # 因此这里单独复制 kwargs,确保序列化过程没有意外副作用。+ task_kwargs = task.get("kwargs", {})+ task_with_serializable_params["kwargs"] = task_kwargs.copy()- if "params" in task["kwargs"] and isinstance(- task["kwargs"]["params"], VideoParams- ):- task_with_serializable_params["kwargs"]["params"] = task["kwargs"][+ if "params" in task_kwargs and isinstance(task_kwargs["params"], VideoParams):+ task_with_serializable_params["kwargs"]["params"] = task_kwargs["params"- ].dict()+ ].model_dump(warnings=False)# 将函数对象转换为其名称task_with_serializable_params["func"] = task["func"].__name__diff --git a/app/controllers/v1/video.py b/app/controllers/v1/video.pyindex 0302dcdd..af36e8d9 100644--- a/app/controllers/v1/video.py+++ b/app/controllers/v1/video.py@@ -113,6 +113,55 @@ def _task_file_to_uri(file: str, endpoint: str, task_dir: str, request_id: str)return f"/{uri_path}"+def _parse_byte_range(+ range_header: str | None, file_size: int, request_id: str+) -> tuple[int, int]:+ """解析单段 HTTP Range,并把无效或越界请求稳定转换成 416。"""+ if file_size <= 0:+ raise HttpException(+ task_id=request_id,+ status_code=416,+ message=f"{request_id}: requested range is not satisfiable",+ )++ if not range_header:+ return 0, file_size - 1++ try:+ # 视频播放器这里只需要单段 bytes range。拒绝多段请求可以避免返回体+ # 与 Content-Range 不一致,也避免异常字符串落入 int() 产生 500。+ if not range_header.startswith("bytes=") or "," in range_header:+ raise ValueError("unsupported range format")+ start_text, end_text = range_header[6:].split("-", 1)+ if not start_text and not end_text:+ raise ValueError("empty range")++ if not start_text:+ suffix_length = int(end_text)+ if suffix_length <= 0:+ raise ValueError("invalid suffix length")+ start = max(file_size - suffix_length, 0)+ end = file_size - 1+ else:+ start = int(start_text)+ end = int(end_text) if end_text else file_size - 1+ if start < 0 or start >= file_size or end < start:+ raise ValueError("range outside file")+ end = min(end, file_size - 1)+ except (TypeError, ValueError) as exc:+ logger.warning(+ f"reject invalid video range, request_id: {request_id}, "+ f"range: {range_header}, file_size: {file_size}, error: {str(exc)}"+ )+ raise HttpException(+ task_id=request_id,+ status_code=416,+ message=f"{request_id}: requested range is not satisfiable",+ ) from exc++ return start, end++@router.post("/videos", response_model=TaskResponse, summary="Generate a short video")def create_video(background_tasks: BackgroundTasks, request: Request, body: TaskVideoRequest@@ -334,9 +383,10 @@ def upload_video_material_file(request: Request, file: UploadFile = File(...)):safe_filename = _sanitize_upload_filename(file.filename, request_id)# check file extallowed_suffixes = ("mp4", "mov", "avi", "flv", "mkv", "jpg", "jpeg", "png")- normalized_filename = safe_filename.lower()- # 统一按小写扩展名校验,兼容 .MOV 这类大写后缀文件。- if normalized_filename.endswith(allowed_suffixes):+ suffix = pathlib.Path(safe_filename).suffix.lower().lstrip(".")+ # 按完整扩展名校验,既兼容 .MOV 这类大写后缀,也避免 photojpg 这种没有+ # 点号的文件名因为 endswith("jpg") 被误当成合法图片。+ if suffix in allowed_suffixes:local_videos_dir = utils.storage_dir("local_videos", create=True)save_path = os.path.join(local_videos_dir, safe_filename)# save file@@ -358,18 +408,8 @@ async def stream_video(request: Request, file_path: str):video_path = _resolve_path_within_directory(tasks_dir, file_path, request_id)range_header = request.headers.get("Range")video_size = os.path.getsize(video_path)- start, end = 0, video_size - 1-- length = video_size- if range_header:- range_ = range_header.split("bytes=")[1]- start, end = [int(part) if part else None for part in range_.split("-")]- if start is None:- start = video_size - end- end = video_size - 1- if end is None:- end = video_size - 1- length = end - start + 1+ start, end = _parse_byte_range(range_header, video_size, request_id)+ length = end - start + 1def file_iterator(file_path, offset=0, bytes_to_read=None):with open(file_path, "rb") as f:diff --git a/app/services/voice.py b/app/services/voice.pyindex 2c7d983c..7a1176e6 100644--- a/app/services/voice.py+++ b/app/services/voice.py@@ -1144,6 +1144,11 @@ def gemini_tts(logger.error(f"Failed to load PCM audio: {e}")return None+ # API、CLI 或测试可以直接把尚不存在的嵌套目录作为输出位置。这里在+ # 真正写文件前统一创建父目录,避免一次成功的 Gemini 请求最后因为+ # 本地路径不存在而丢失结果,也让该 provider 与其他 TTS 实现行为一致。+ ensure_file_path_exists(voice_file)+# pydub 会返回打开的输出文件对象。批量生成时若不主动关闭,文件描述符# 会持续累积,并在 Windows 上增加后续覆盖或删除音频文件失败的概率。exported_audio = audio_segment.export(voice_file, format="mp3")diff --git a/pyproject.toml b/pyproject.tomlindex 3304ee68..eac8501d 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -43,6 +43,28 @@ twelvelabs = ["twelvelabs>=1.2.8",]+[dependency-groups]+dev = [+ "coverage==7.15.1",+ "pytest==9.1.1",+]++[tool.coverage.run]+# 统计分支覆盖率可以识别“代码行执行了,但条件的另一条分支从未验证”的情况,+# 比只统计行覆盖率更适合作为 CI 质量基线。CLI 和 WebUI 都属于生产入口,+# 因此与 app 服务层、服务启动入口和面向 Agent 用户发布的 Skill 脚本一起+# 纳入统计,避免覆盖率只反映局部模块。+branch = true+source = ["app", "cli", "webui", "main", "docs/skill"]++[tool.coverage.report]+# 当前 pytest 完整测试的实测分支覆盖率为 68.19%。以 67% 作为稳定底线,+# 既能把本次新增覆盖固化为 CI 质量门槛,也为 macOS、Windows 和 Linux+# 之间少量平台分支差异保留余量;后续增加测试后可继续逐步提高该阈值。+fail_under = 67+show_missing = true+skip_covered = true+[tool.hatch.build.targets.wheel]packages = ["app"]diff --git a/test/README.md b/test/README.mdindex 967f4be9..c9c38db5 100644--- a/test/README.md+++ b/test/README.md@@ -4,28 +4,38 @@ This directory contains unit tests for the **MoneyPrinterTurbo** project.## Directory Structure-- `services/`: Tests for components in the `app/services` directory- - `test_video.py`: Tests for the video service- - `test_task.py`: Tests for the task service- - `test_voice.py`: Tests for the voice service+- `services/`: Domain-focused unit and controller tests+ - `test_task.py`: Task pipeline tests+ - `test_task_manager.py`: In-memory and Redis queue tests+ - `test_controller_*.py`: API controller tests split by controller domain+ - `test_video.py`, `test_voice.py`: Media service tests+- `test_main.py`: Application entry-point test## Running Tests-You can run the tests using Python’s built-in `unittest` framework:+The CI suite uses pytest, which also runs the existing `unittest.TestCase`+tests:```bash# Run all tests-python -m unittest discover -s test+uv run python -X utf8 -m pytest -q test# Run a specific test file-python -m unittest test/services/test_video.py+uv run python -X utf8 -m pytest -q test/services/test_video.py# Run a specific test class-python -m unittest test.services.test_video.TestVideoService+uv run python -X utf8 -m pytest -q test/services/test_video.py::TestVideoService# Run a specific test method-python -m unittest test.services.test_video.TestVideoService.test_preprocess_video-````+uv run python -X utf8 -m pytest -q test/services/test_video.py::TestVideoService::test_preprocess_video+```++To run the same branch coverage check used by CI:++```bash+uv run python -X utf8 -m coverage run -m pytest -q test+uv run python -m coverage report+```Live provider tests are skipped by default. To run tests that may call externalTTS or LLM services, set `MPT_RUN_INTEGRATION_TESTS=1` and provide the required@@ -35,9 +45,10 @@ provider credentials.To add tests for other components, follow these guidelines:-1. Create test files prefixed with `test_` in the appropriate subdirectory-2. Use `unittest.TestCase` as the base class for your test classes-3. Name test methods with the `test_` prefix+1. Name files `test_<domain>.py` and keep each file focused on one domain.+2. Split broad controller suites into files such as `test_controller_video.py`.+3. Use either pytest functions or `unittest.TestCase`; pytest collects both.+4. Name test functions and methods with the `test_` prefix.## Test Resourcesdiff --git a/test/services/test_controller_base.py b/test/services/test_controller_base.pynew file mode 100644index 00000000..edd4804d--- /dev/null+++ b/test/services/test_controller_base.py@@ -0,0 +1,79 @@+import unittest+from types import SimpleNamespace++from app.config import config+from app.controllers import base+from app.controllers.v1.base import new_router+from app.models.exception import HttpException+++class TestControllerAuthentication(unittest.TestCase):+ def setUp(self):+ self.original_app_config = dict(config.app)++ def tearDown(self):+ config.app.clear()+ config.app.update(self.original_app_config)++ @staticmethod+ def _request(headers=None):+ return SimpleNamespace(+ headers=headers or {},+ url="http://localhost/api/v1/tasks",+ )++ def test_get_task_id_reuses_header_or_generates_uuid(self):+ """+ 客户端提供 request ID 时需要原样保留,缺失时则生成可记录到日志和+ 错误响应中的 UUID,保证两种入口都有可追踪标识。+ """+ self.assertEqual(+ base.get_task_id(self._request({"x-task-id": "request-123"})),+ "request-123",+ )++ generated = base.get_task_id(self._request())+ self.assertEqual(len(generated), 36)+ self.assertEqual(generated.count("-"), 4)++ def test_verify_token_accepts_matching_key(self):+ """配置了 API Key 时,相同请求头必须正常通过鉴权。"""+ config.app["api_key"] = "secret"++ result = base.verify_token(self._request({"x-api-key": "secret"}))++ self.assertIsNone(result)++ def test_verify_token_rejects_missing_or_wrong_key(self):+ """+ 缺失和错误的 API Key 都必须返回 401,并保留客户端 request ID,+ 避免鉴权失败在日志中无法与调用方请求对应。+ """+ config.app["api_key"] = "secret"++ for provided_key in (None, "wrong"):+ with self.subTest(provided_key=provided_key):+ headers = {"x-task-id": "auth-request"}+ if provided_key is not None:+ headers["x-api-key"] = provided_key++ with self.assertRaises(HttpException) as raised:+ base.verify_token(self._request(headers))++ self.assertEqual(raised.exception.status_code, 401)+ self.assertIn("invalid token", raised.exception.message)++ def test_new_router_preserves_common_prefix_and_dependencies(self):+ """所有 V1 路由都应复用统一前缀,并仅在传入时设置鉴权依赖。"""+ dependency = object()++ plain_router = new_router()+ protected_router = new_router(dependencies=[dependency])++ self.assertEqual(plain_router.prefix, "/api/v1")+ self.assertEqual(plain_router.tags, ["V1"])+ self.assertEqual(protected_router.dependencies, [dependency])+++if __name__ == "__main__":+ unittest.main()diff --git a/test/services/test_controller_llm.py b/test/services/test_controller_llm.pynew file mode 100644index 00000000..69e9c382--- /dev/null+++ b/test/services/test_controller_llm.py@@ -0,0 +1,100 @@+import unittest+from unittest.mock import patch++from app.controllers.v1 import llm as llm_controller+from app.models.schema import (+ VideoScriptRequest,+ VideoSocialMetadataRequest,+ VideoTermsRequest,+)+++class TestLlmController(unittest.TestCase):+ def test_generate_video_script_forwards_all_prompt_fields(self):+ """文案接口不能丢失高级提示词或段落数量。"""+ body = VideoScriptRequest(+ video_subject="Coffee",+ video_language="en",+ paragraph_number=2,+ video_script_prompt="Friendly tone",+ custom_system_prompt="Return narration only.",+ )++ with patch.object(+ llm_controller.llm,+ "generate_script",+ return_value="Generated script",+ ) as generate:+ response = llm_controller.generate_video_script(None, body)++ self.assertEqual(+ response,+ {"status": 200, "data": {"video_script": "Generated script"}},+ )+ generate.assert_called_once_with(+ video_subject="Coffee",+ language="en",+ paragraph_number=2,+ video_script_prompt="Friendly tone",+ custom_system_prompt="Return narration only.",+ )++ def test_generate_video_terms_forwards_order_matching_mode(self):+ """素材顺序匹配开关必须继续传递到关键词生成服务。"""+ body = VideoTermsRequest(+ video_subject="Coffee",+ video_script="First beans, then brewing.",+ amount=4,+ match_materials_to_script=True,+ )++ with patch.object(+ llm_controller.llm,+ "generate_terms",+ return_value=["beans", "brewing"],+ ) as generate:+ response = llm_controller.generate_video_terms(None, body)++ self.assertEqual(+ response,+ {"status": 200, "data": {"video_terms": ["beans", "brewing"]}},+ )+ generate.assert_called_once_with(+ video_subject="Coffee",+ video_script="First beans, then brewing.",+ amount=4,+ match_script_order=True,+ )++ def test_generate_social_metadata_returns_service_payload(self):+ """社交平台元数据接口应保持服务层结果的响应结构。"""+ body = VideoSocialMetadataRequest(+ video_subject="Coffee",+ video_script="Morning coffee.",+ language="en",+ platform="youtube_shorts",+ )+ metadata = {+ "title": "Morning Coffee",+ "caption": "Start the day.",+ "hashtags": ["#coffee"],+ }++ with patch.object(+ llm_controller.llm,+ "generate_social_metadata",+ return_value=metadata,+ ) as generate:+ response = llm_controller.generate_video_social_metadata(None, body)++ self.assertEqual(response, {"status": 200, "data": metadata})+ generate.assert_called_once_with(+ video_subject="Coffee",+ video_script="Morning coffee.",+ language="en",+ platform="youtube_shorts",+ )+++if __name__ == "__main__":+ unittest.main()diff --git a/test/services/test_controller_video.py b/test/services/test_controller_video.pynew file mode 100644index 00000000..c5b1263d--- /dev/null+++ b/test/services/test_controller_video.py@@ -0,0 +1,314 @@+import asyncio+import os+import shutil+import tempfile+import unittest+from io import BytesIO+from pathlib import Path+from types import SimpleNamespace+from unittest.mock import MagicMock, patch++from app.config import config+from app.controllers.manager.base_manager import TaskQueueFullError+from app.controllers.v1 import video as video_controller+from app.models import const+from app.models.exception import HttpException+from app.services import state as sm+from app.utils import utils+++class TestVideoControllerHelpers(unittest.TestCase):+ @staticmethod+ def _request(range_header=None):+ headers = {"x-task-id": "request-123"}+ if range_header is not None:+ headers["Range"] = range_header+ return SimpleNamespace(headers=headers)++ def test_sanitize_upload_filename_removes_client_path(self):+ """Windows 和 POSIX 客户端路径都只能保留最后一段安全文件名。"""+ for filename, expected in (+ (r"C:\videos\clip.MOV", "clip.MOV"),+ ("../../images/photo.png", "photo.png"),+ ):+ with self.subTest(filename=filename):+ self.assertEqual(+ video_controller._sanitize_upload_filename(+ filename, "request-123"+ ),+ expected,+ )++ def test_sanitize_upload_filename_rejects_empty_name(self):+ """空文件名和目录占位符不能进入服务端存储路径。"""+ for filename in ("", ".", "..", "/"):+ with self.subTest(filename=filename):+ with self.assertRaises(HttpException) as raised:+ video_controller._sanitize_upload_filename(+ filename, "request-123"+ )+ self.assertEqual(raised.exception.status_code, 400)++ def test_resolve_path_maps_missing_and_unsafe_files(self):+ """不存在文件返回 404,目录穿越等非法路径返回 403。"""+ for error, expected_status in (+ ("file does not exist", 404),+ ("path escapes base directory", 403),+ ):+ with self.subTest(error=error):+ with patch.object(+ video_controller.file_security,+ "resolve_path_within_directory",+ side_effect=ValueError(error),+ ):+ with self.assertRaises(HttpException) as raised:+ video_controller._resolve_path_within_directory(+ "/tasks", "../secret", "request-123"+ )+ self.assertEqual(raised.exception.status_code, expected_status)++ def test_parse_byte_range_supports_common_player_requests(self):+ """播放器常见的闭区间、开放区间和后缀区间都应得到准确边界。"""+ cases = (+ (None, (0, 9)),+ ("bytes=2-5", (2, 5)),+ ("bytes=4-", (4, 9)),+ ("bytes=-4", (6, 9)),+ ("bytes=2-50", (2, 9)),+ )+ for header, expected in cases:+ with self.subTest(header=header):+ self.assertEqual(+ video_controller._parse_byte_range(+ header, 10, "request-123"+ ),+ expected,+ )++ def test_parse_byte_range_rejects_malformed_or_out_of_bounds_requests(self):+ """非法 Range 必须返回 416,不能因 split 或 int 转换异常变成 500。"""+ invalid_headers = (+ "items=0-1",+ "bytes=",+ "bytes=10-",+ "bytes=5-2",+ "bytes=0-1,3-4",+ )+ for header in invalid_headers:+ with self.subTest(header=header):+ with self.assertRaises(HttpException) as raised:+ video_controller._parse_byte_range(+ header, 10, "request-123"+ )+ self.assertEqual(raised.exception.status_code, 416)+++class TestVideoControllerTasks(unittest.TestCase):+ @staticmethod+ def _request():+ return SimpleNamespace(headers={"x-task-id": "request-123"})++ def test_create_task_queues_requested_pipeline_stage(self):+ """创建任务应持久化初始状态,并把原请求模型与停止阶段交给队列。"""+ body = MagicMock()+ body.model_dump.return_value = {"video_subject": "Coffee"}++ with (+ patch.object(video_controller.utils, "get_uuid", return_value="task-123"),+ patch.object(video_controller.sm.state, "update_task") as update_task,+ patch.object(video_controller.task_manager, "add_task") as add_task,+ ):+ response = video_controller.create_task(+ self._request(), body, stop_at="audio"+ )++ self.assertEqual(response["status"], 200)+ self.assertEqual(response["data"]["task_id"], "task-123")+ self.assertEqual(response["data"]["request_id"], "request-123")+ update_task.assert_called_once_with("task-123")+ add_task.assert_called_once_with(+ video_controller.tm.start,+ task_id="task-123",+ params=body,+ stop_at="audio",+ )++ def test_create_task_removes_state_when_queue_is_full(self):+ """队列已满时必须回滚刚创建的状态,并向调用方返回 429。"""+ body = MagicMock()+ body.model_dump.return_value = {"video_subject": "Coffee"}++ with (+ patch.object(video_controller.utils, "get_uuid", return_value="task-123"),+ patch.object(video_controller.sm.state, "update_task"),+ patch.object(+ video_controller.task_manager,+ "add_task",+ side_effect=TaskQueueFullError("queue full"),+ ),+ patch.object(video_controller.sm.state, "delete_task") as delete_task,+ ):+ with self.assertRaises(HttpException) as raised:+ video_controller.create_task(+ self._request(), body, stop_at="video"+ )++ self.assertEqual(raised.exception.status_code, 429)+ delete_task.assert_called_once_with("task-123")++ def test_get_all_tasks_preserves_pagination(self):+ """任务列表响应必须包含状态层返回的总数和请求分页参数。"""+ with patch.object(+ video_controller.sm.state,+ "get_all_tasks",+ return_value=([{"id": "task-1"}], 21),+ ) as get_all:+ response = video_controller.get_all_tasks(+ self._request(), page=2, page_size=10+ )++ self.assertEqual(+ response["data"],+ {+ "tasks": [{"id": "task-1"}],+ "total": 21,+ "page": 2,+ "page_size": 10,+ },+ )+ get_all.assert_called_once_with(2, 10)++ def test_task_query_returns_relative_url_without_mutating_state(self):+ """+ endpoint 未配置时应返回相对任务 URL,且不能把展示用 URL 回写到状态,+ 否则后续请求可能基于已改写数据重复拼接路径。+ """+ task_id = "controller-task-url"+ task_dir = utils.task_dir(task_id)+ video_path = os.path.join(task_dir, "final-1.mp4")+ Path(video_path).write_bytes(b"fake-video")++ try:+ sm.state.update_task(+ task_id,+ state=const.TASK_STATE_COMPLETE,+ videos=[video_path],+ combined_videos=[video_path],+ )+ with patch.dict(config.app, {"endpoint": ""}):+ response = video_controller.get_task(+ self._request(), task_id=task_id, query=MagicMock()+ )++ self.assertEqual(+ response["data"]["videos"],+ [f"/tasks/{task_id}/final-1.mp4"],+ )+ self.assertEqual(sm.state.get_task(task_id)["videos"], [video_path])+ finally:+ sm.state.delete_task(task_id)+ shutil.rmtree(task_dir, ignore_errors=True)++ def test_get_and_delete_missing_task_return_404(self):+ """查询或删除未知任务都应返回一致的 404,而不是空成功响应。"""+ with patch.object(video_controller.sm.state, "get_task", return_value=None):+ for operation in (+ lambda: video_controller.get_task(+ self._request(), task_id="missing", query=MagicMock()+ ),+ lambda: video_controller.delete_video(+ self._request(), task_id="missing"+ ),+ ):+ with self.subTest(operation=operation):+ with self.assertRaises(HttpException) as raised:+ operation()+ self.assertEqual(raised.exception.status_code, 404)+++class TestVideoControllerFiles(unittest.TestCase):+ @staticmethod+ def _request(range_header=None):+ headers = {"x-task-id": "request-123"}+ if range_header is not None:+ headers["Range"] = range_header+ return SimpleNamespace(headers=headers)++ def test_upload_video_material_validates_complete_extension(self):+ """大写合法扩展名应接受,无点号伪扩展名应拒绝。"""+ with tempfile.TemporaryDirectory() as temp_dir:+ upload = SimpleNamespace(+ filename=r"C:\videos\clip.MOV",+ file=BytesIO(b"video"),+ )+ with patch.object(+ video_controller.utils,+ "storage_dir",+ return_value=temp_dir,+ ):+ response = video_controller.upload_video_material_file(+ self._request(), upload+ )++ self.assertEqual(response["data"]["file"], "clip.MOV")+ self.assertEqual(Path(temp_dir, "clip.MOV").read_bytes(), b"video")++ invalid_upload = SimpleNamespace(+ filename="photojpg",+ file=BytesIO(b"not-an-image"),+ )+ with self.assertRaises(HttpException) as raised:+ video_controller.upload_video_material_file(+ self._request(), invalid_upload+ )+ self.assertEqual(raised.exception.status_code, 400)++ def test_stream_video_returns_requested_bytes(self):+ """Range 响应的正文和 Content-Range 必须与计算出的区间一致。"""++ async def consume(response):+ return b"".join([chunk async for chunk in response.body_iterator])++ with tempfile.TemporaryDirectory() as temp_dir:+ Path(temp_dir, "clip.mp4").write_bytes(b"0123456789")+ with patch.object(+ video_controller.utils,+ "task_dir",+ return_value=temp_dir,+ ):+ response = asyncio.run(+ video_controller.stream_video(+ self._request("bytes=2-5"), "clip.mp4"+ )+ )+ body = asyncio.run(consume(response))++ self.assertEqual(response.status_code, 206)+ self.assertEqual(response.headers["content-range"], "bytes 2-5/10")+ self.assertEqual(response.headers["content-length"], "4")+ self.assertEqual(body, b"2345")++ def test_download_video_uses_resolved_file(self):+ """下载响应应使用白名单目录解析后的真实路径和原始文件名。"""+ with tempfile.TemporaryDirectory() as temp_dir:+ video_path = Path(temp_dir, "final-1.mp4")+ video_path.write_bytes(b"video")+ with patch.object(+ video_controller.utils,+ "task_dir",+ return_value=temp_dir,+ ):+ response = asyncio.run(+ video_controller.download_video(+ self._request(), "final-1.mp4"+ )+ )++ # macOS 的 /var 是 /private/var 符号链接,安全解析会返回真实路径。+ self.assertEqual(response.path, os.path.realpath(video_path))+ self.assertEqual(response.filename, "final-1.mp4")+ self.assertEqual(response.media_type, "video/mp4")+++if __name__ == "__main__":+ unittest.main()diff --git a/test/services/test_subtitle.py b/test/services/test_subtitle.pyindex c95a0d4a..0595bb7a 100644--- a/test/services/test_subtitle.py+++ b/test/services/test_subtitle.py@@ -2,6 +2,8 @@ import sysimport tempfileimport unittestfrom pathlib import Path+from types import SimpleNamespace+from unittest.mock import patch# 测试文件直接运行时,也能从仓库根目录导入 app 包。sys.path.insert(0, str(Path(__file__).parent.parent.parent))@@ -10,6 +12,75 @@ from app.services import subtitleclass TestSubtitleService(unittest.TestCase):+ def test_file_to_subtitles_returns_empty_for_missing_input(self):+ """空路径和不存在的文件都应安全返回空列表。"""+ self.assertEqual(subtitle.file_to_subtitles(""), [])+ with tempfile.TemporaryDirectory() as tmp_dir:+ missing_file = Path(tmp_dir) / "missing.srt"+ self.assertEqual(subtitle.file_to_subtitles(str(missing_file)), [])++ def test_levenshtein_distance_and_similarity_cover_common_boundaries(self):+ """+ 字幕校正依赖编辑距离选择是否继续合并相邻字幕,因此覆盖空字符串、+ 参数交换、大小写忽略和明显不相似四种边界,防止算法调整后误合并。+ """+ self.assertEqual(subtitle.levenshtein_distance("kitten", "sitting"), 3)+ self.assertEqual(subtitle.levenshtein_distance("a", "longer"), 6)+ self.assertEqual(subtitle.levenshtein_distance("hello", ""), 5)+ self.assertEqual(subtitle.similarity("Hello", "hello"), 1.0)+ self.assertLess(subtitle.similarity("hello", "world"), 0.5)++ def test_create_returns_empty_when_whisper_is_unavailable(self):+ """可选 Whisper 依赖未安装时应跳过,而不是在任务线程中抛异常。"""+ with patch.object(subtitle, "WhisperModel", None):+ self.assertEqual(subtitle.create("audio.mp3"), "")++ def test_create_returns_none_when_whisper_model_cannot_load(self):+ """模型下载或初始化失败时必须返回失败结果,并允许任务层更新状态。"""+ with patch.object(subtitle, "model", None), patch.object(+ subtitle,+ "WhisperModel",+ side_effect=RuntimeError("model unavailable"),+ ):+ self.assertIsNone(subtitle.create("audio.mp3"))++ def test_create_writes_punctuated_and_trailing_segments(self):+ """+ 使用假的 Whisper 模型覆盖逐词时间戳处理,不访问网络也不加载真实模型。+ 一个 segment 同时包含标点断句和末尾无标点文本,可验证两条关键写入路径。+ """++ class _FakeWhisperModel:+ def __init__(self, **kwargs):+ self.init_kwargs = kwargs++ def transcribe(self, audio_file, **kwargs):+ words = [+ SimpleNamespace(start=0.0, end=0.4, word="Hello"),+ SimpleNamespace(start=0.4, end=0.9, word=" world."),+ SimpleNamespace(start=1.0, end=1.5, word="Again"),+ ]+ segment = SimpleNamespace(+ start=0.0,+ end=1.8,+ words=words,+ )+ info = SimpleNamespace(language="en", language_probability=0.99)+ return [segment], info++ with tempfile.TemporaryDirectory() as tmp_dir:+ subtitle_file = Path(tmp_dir) / "generated.srt"+ with patch.object(subtitle, "model", None), patch.object(+ subtitle,+ "WhisperModel",+ _FakeWhisperModel,+ ):+ subtitle.create("audio.mp3", str(subtitle_file))++ items = subtitle.file_to_subtitles(str(subtitle_file))++ self.assertEqual([item[2] for item in items], ["Hello world", "Again"])+def test_correct_ignores_markdown_separator_lines(self):"""Whisper fallback 校正阶段也必须忽略 `---` 这类不可发声脚本行。@@ -43,6 +114,47 @@ class TestSubtitleService(unittest.TestCase):self.assertNotIn("---", corrected_srt)self.assertNotIn("00:00:00,000 --> 00:00:00,000", corrected_srt)+ def test_correct_merges_adjacent_subtitles_for_one_script_sentence(self):+ """+ Whisper 可能把一句文案拆成多个时间块。校正逻辑应合并时间范围并恢复+ 原始脚本文本,避免最终字幕出现不必要的碎片。+ """+ original_srt = (+ "1\n00:00:00,100 --> 00:00:01,000\nHello\n\n"+ "2\n00:00:01,000 --> 00:00:02,000\nworld\n\n"+ )++ with tempfile.TemporaryDirectory() as tmp_dir:+ subtitle_file = Path(tmp_dir) / "subtitle.srt"+ subtitle_file.write_text(original_srt, encoding="utf-8")++ subtitle.correct(str(subtitle_file), "Hello world")+ items = subtitle.file_to_subtitles(str(subtitle_file))++ self.assertEqual(len(items), 1)+ self.assertEqual(items[0][1], "00:00:00,100 --> 00:00:02,000")+ self.assertEqual(items[0][2], "Hello world")++ def test_correct_replaces_mismatch_and_appends_missing_script_line(self):+ """+ 转写结果与脚本完全不一致时仍应以脚本为准;脚本多出的句子没有可复用+ 时间轴时使用明确的零时间占位,避免丢失文本且保持现有兼容行为。+ """+ original_srt = "1\n00:00:00,100 --> 00:00:01,000\nWrong text\n\n"++ with tempfile.TemporaryDirectory() as tmp_dir:+ subtitle_file = Path(tmp_dir) / "subtitle.srt"+ subtitle_file.write_text(original_srt, encoding="utf-8")++ subtitle.correct(str(subtitle_file), "Expected sentence. Extra sentence.")+ items = subtitle.file_to_subtitles(str(subtitle_file))++ self.assertEqual(+ [item[2] for item in items],+ ["Expected sentence", "Extra sentence"],+ )+ self.assertEqual(items[1][1], "00:00:00,000 --> 00:00:00,000")+def test_file_to_subtitles_keeps_last_block_without_trailing_newline(self):"""The final subtitle must be parsed even when the SRT file does not enddiff --git a/test/services/test_task.py b/test/services/test_task.pyindex 4bd541a0..d83178a6 100644--- a/test/services/test_task.py+++ b/test/services/test_task.py@@ -306,6 +306,240 @@ class TestTaskService(unittest.TestCase):create_subtitle.assert_not_called()whisper_create.assert_not_called()+ def test_start_returns_each_intermediate_result(self):+ """+ API 的 script、terms、audio、subtitle 和 materials 模式共用同一条任务+ 流水线。每个提前停止点都要返回对应产物,同时不能误执行后续阶段。+ """+ expected_results = {+ "script": {"script": "generated script"},+ "terms": {+ "script": "generated script",+ "terms": ["coffee", "morning"],+ },+ "audio": {"audio_file": "audio.mp3", "audio_duration": 5},+ "subtitle": {"subtitle_path": "subtitle.srt"},+ "materials": {"materials": ["clip.mp4"]},+ }++ for stop_at, expected in expected_results.items():+ with self.subTest(stop_at=stop_at):+ params = VideoParams(video_subject="Coffee")+ with (+ patch.object(tm, "generate_script", return_value="generated script"),+ patch.object(+ tm,+ "generate_terms",+ return_value=["coffee", "morning"],+ ),+ patch.object(tm, "save_script_data"),+ patch.object(+ tm,+ "generate_audio",+ return_value=("audio.mp3", 5, object()),+ ),+ patch.object(+ tm,+ "generate_subtitle",+ return_value="subtitle.srt",+ ),+ patch.object(+ tm,+ "get_video_materials",+ return_value=["clip.mp4"],+ ),+ patch.object(tm, "generate_final_videos") as generate_final,+ patch.object(tm.sm.state, "update_task"),+ ):+ result = tm.start(+ f"intermediate-{stop_at}", params, stop_at=stop_at+ )++ self.assertEqual(result, expected)+ generate_final.assert_not_called()++ def test_start_completes_video_without_cross_posting(self):+ """+ 完整任务在自动发布未配置时仍应稳定完成,并把所有中间产物写入最终+ 状态。这里还覆盖 API 可能传入字符串拼接模式的兼容转换。+ """+ params = VideoParams(video_subject="Coffee")+ params.video_concat_mode = "sequential"++ with (+ patch.object(tm, "generate_script", return_value="generated script"),+ patch.object(tm, "generate_terms", return_value=["coffee"]),+ patch.object(tm, "save_script_data"),+ patch.object(+ tm,+ "generate_audio",+ return_value=("audio.mp3", 5, object()),+ ),+ patch.object(tm, "generate_subtitle", return_value="subtitle.srt"),+ patch.object(+ tm,+ "get_video_materials",+ return_value=["clip.mp4"],+ ),+ patch.object(+ tm,+ "generate_final_videos",+ return_value=(["final.mp4"], ["combined.mp4"]),+ ),+ patch.object(+ tm.upload_post.upload_post_service,+ "is_configured",+ return_value=False,+ ),+ patch.object(tm.upload_post, "cross_post_video") as cross_post,+ patch.object(tm.sm.state, "update_task") as update_task,+ ):+ result = tm.start("complete-video", params)++ self.assertEqual(result["videos"], ["final.mp4"])+ self.assertEqual(result["combined_videos"], ["combined.mp4"])+ self.assertEqual(result["cross_post_results"], None)+ self.assertEqual(params.video_concat_mode, tm.VideoConcatMode.sequential)+ cross_post.assert_not_called()+ update_task.assert_called_with(+ "complete-video",+ state=tm.const.TASK_STATE_COMPLETE,+ progress=100,+ **result,+ )++ def test_start_marks_pipeline_failures(self):+ """+ 音频、素材和最终视频任一关键产物缺失时都必须进入失败状态,不能把+ 不完整任务误报为完成。三个场景复用相同 mock,仅替换故障阶段。+ """+ failure_cases = {+ "audio": (+ (None, None, None),+ ["clip.mp4"],+ (["final.mp4"], ["combined.mp4"]),+ ),+ "materials": (+ ("audio.mp3", 5, object()),+ None,+ (["final.mp4"], ["combined.mp4"]),+ ),+ "video": (("audio.mp3", 5, object()), ["clip.mp4"], ([], [])),+ }++ for stage, failure_results in failure_cases.items():+ with self.subTest(stage=stage):+ audio_result, materials_result, videos_result = failure_results+ params = VideoParams(video_subject="Coffee")+ with (+ patch.object(tm, "generate_script", return_value="generated script"),+ patch.object(tm, "generate_terms", return_value=["coffee"]),+ patch.object(tm, "save_script_data"),+ patch.object(tm, "generate_audio", return_value=audio_result),+ patch.object(tm, "generate_subtitle", return_value="subtitle.srt"),+ patch.object(+ tm,+ "get_video_materials",+ return_value=materials_result,+ ),+ patch.object(+ tm,+ "generate_final_videos",+ return_value=videos_result,+ ),+ patch.object(tm.sm.state, "update_task") as update_task,+ ):+ result = tm.start(f"failed-{stage}", params)++ self.assertIsNone(result)+ update_task.assert_any_call(+ f"failed-{stage}", state=tm.const.TASK_STATE_FAILED+ )++ def test_start_generates_youtube_metadata_for_each_cross_post(self):+ """+ 自动发布到 YouTube 时只生成一次元数据,但要把同一份字段传给每个+ 成片,并在任务结果中保留每次上传成功或失败的独立结果。+ """+ params = VideoParams(+ video_subject="Coffee",+ video_language="en",+ )+ metadata = {+ "title": "Morning Coffee",+ "caption": "A better morning.",+ "hashtags": ["coffee", "shorts"],+ }+ service = tm.upload_post.upload_post_service++ with (+ patch.object(tm, "generate_script", return_value="generated script"),+ patch.object(tm, "generate_terms", return_value=["coffee"]),+ patch.object(tm, "save_script_data"),+ patch.object(+ tm,+ "generate_audio",+ return_value=("audio.mp3", 5, object()),+ ),+ patch.object(tm, "generate_subtitle", return_value="subtitle.srt"),+ patch.object(+ tm,+ "get_video_materials",+ return_value=["clip.mp4"],+ ),+ patch.object(+ tm,+ "generate_final_videos",+ return_value=(+ ["final-1.mp4", "final-2.mp4"],+ ["combined-1.mp4", "combined-2.mp4"],+ ),+ ),+ patch.object(service, "is_configured", return_value=True),+ patch.object(service, "auto_upload", True),+ patch.object(service, "platforms", ["youtube"]),+ patch.object(service, "youtube_privacy_status", "unlisted"),+ patch.object(+ tm.llm,+ "generate_social_metadata",+ return_value=metadata,+ ) as generate_metadata,+ patch.object(+ tm.upload_post,+ "cross_post_video",+ side_effect=[+ {"success": True},+ {"success": False, "error": "upload failed"},+ ],+ ) as cross_post,+ patch.object(tm.sm.state, "update_task"),+ ):+ result = tm.start("youtube-cross-post", params)++ generate_metadata.assert_called_once_with(+ video_subject="Coffee",+ video_script="generated script",+ language="en",+ platform="youtube_shorts",+ )+ expected_extra = {+ "youtube_title": "Morning Coffee",+ "youtube_description": "A better morning.",+ "tags": ["coffee", "shorts"],+ "privacyStatus": "unlisted",+ "containsSyntheticMedia": True,+ }+ self.assertEqual(cross_post.call_count, 2)+ for call in cross_post.call_args_list:+ self.assertEqual(call.kwargs["youtube_extra"], expected_extra)+ self.assertEqual(+ result["cross_post_results"],+ [+ {"success": True},+ {"success": False, "error": "upload failed"},+ ],+ )+@unittest.skipUnless(RUN_INTEGRATION_TESTS,"MPT_RUN_INTEGRATION_TESTS not set",diff --git a/test/services/test_task_manager.py b/test/services/test_task_manager.pynew file mode 100644index 00000000..428ae02a--- /dev/null+++ b/test/services/test_task_manager.py@@ -0,0 +1,195 @@+import json+import unittest+from unittest.mock import MagicMock, patch++from app.controllers.manager.base_manager import TaskQueueFullError+from app.controllers.manager.memory_manager import InMemoryTaskManager+from app.controllers.manager.redis_manager import RedisTaskManager+from app.models.schema import VideoParams+from app.services import task as task_service+++class TestInMemoryTaskManager(unittest.TestCase):+ def test_queue_operations_preserve_task_payload(self):+ """内存队列应保持函数、位置参数和关键字参数,不得改变任务内容。"""+ manager = InMemoryTaskManager(max_concurrent_tasks=1, max_queued_tasks=2)+ task = {"func": len, "args": ([1, 2],), "kwargs": {}}++ manager.enqueue(task)++ self.assertFalse(manager.is_queue_empty())+ self.assertEqual(manager.queue_size(), 1)+ self.assertEqual(manager.dequeue(), task)+ self.assertTrue(manager.is_queue_empty())++ def test_add_task_rejects_only_after_queue_limit(self):+ """并发名额用尽后允许排队到上限,超过上限才返回明确错误。"""+ manager = InMemoryTaskManager(max_concurrent_tasks=0, max_queued_tasks=1)++ manager.add_task(len, [1])++ with self.assertRaises(TaskQueueFullError):+ manager.add_task(len, [2])++ def test_add_task_reserves_slot_before_background_thread_runs(self):+ """+ 并发名额必须在线程启动前预占;即使 mock 的线程尚未进入 run_task,+ 第二个请求也应进入队列,不能突破 max_concurrent_tasks。+ """+ manager = InMemoryTaskManager(max_concurrent_tasks=1, max_queued_tasks=1)++ with patch.object(manager, "execute_task") as execute_task:+ manager.add_task(len, [1])+ manager.add_task(len, [2])++ self.assertEqual(manager.current_tasks, 1)+ execute_task.assert_called_once_with(len, [1])+ self.assertEqual(manager.queue_size(), 1)++ def test_add_task_rolls_back_slot_when_thread_cannot_start(self):+ """线程启动失败不能永久占用并发名额,异常仍应交给调用方处理。"""+ manager = InMemoryTaskManager(max_concurrent_tasks=1)++ with patch.object(+ manager,+ "execute_task",+ side_effect=RuntimeError("thread unavailable"),+ ):+ with self.assertRaisesRegex(RuntimeError, "thread unavailable"):+ manager.add_task(len, [1])++ self.assertEqual(manager.current_tasks, 0)++ def test_task_done_starts_next_queued_task(self):+ """当前任务结束后应释放并发名额,并立即调度队列中的下一个任务。"""+ manager = InMemoryTaskManager(max_concurrent_tasks=1, max_queued_tasks=2)+ manager.current_tasks = 1+ manager.enqueue({"func": len, "args": ([1, 2],), "kwargs": {}})++ with patch.object(manager, "execute_task") as execute_task:+ manager.task_done()++ self.assertEqual(manager.current_tasks, 1)+ execute_task.assert_called_once_with(len, [1, 2])+ self.assertTrue(manager.is_queue_empty())++ def test_task_done_requeues_task_when_thread_cannot_start(self):+ """出队后若线程启动失败,应回滚名额并把任务放回队列,避免任务丢失。"""+ manager = InMemoryTaskManager(max_concurrent_tasks=1, max_queued_tasks=1)+ manager.current_tasks = 1+ queued_task = {"func": len, "args": ([1, 2],), "kwargs": {}}+ manager.enqueue(queued_task)++ with patch.object(+ manager,+ "execute_task",+ side_effect=RuntimeError("thread unavailable"),+ ):+ with self.assertRaisesRegex(RuntimeError, "thread unavailable"):+ manager.task_done()++ self.assertEqual(manager.current_tasks, 0)+ self.assertEqual(manager.dequeue(), queued_task)++ def test_run_task_releases_slot_after_failure(self):+ """任务函数抛出异常时 finally 仍必须释放名额,避免队列永久阻塞。"""+ manager = InMemoryTaskManager(max_concurrent_tasks=1)+ manager.current_tasks = 1++ with patch.object(manager, "task_done") as task_done:+ with self.assertRaisesRegex(RuntimeError, "task failed"):+ manager.run_task(MagicMock(side_effect=RuntimeError("task failed")))++ self.assertEqual(manager.current_tasks, 1)+ task_done.assert_called_once_with()++ def test_execute_task_starts_background_thread(self):+ """任务执行入口必须启动线程,并把函数参数完整传给 run_task。"""+ manager = InMemoryTaskManager(max_concurrent_tasks=1)+ fake_thread = MagicMock()++ with patch(+ "app.controllers.manager.base_manager.threading.Thread",+ return_value=fake_thread,+ ) as thread:+ manager.execute_task(len, [1, 2])++ thread.assert_called_once_with(+ target=manager.run_task,+ args=(len, [1, 2]),+ kwargs={},+ )+ fake_thread.start.assert_called_once_with()+++class TestRedisTaskManager(unittest.TestCase):+ def setUp(self):+ self.redis_client = MagicMock()+ patcher = patch(+ "app.controllers.manager.redis_manager.redis.Redis.from_url",+ return_value=self.redis_client,+ )+ self.addCleanup(patcher.stop)+ from_url = patcher.start()+ self.manager = RedisTaskManager(+ max_concurrent_tasks=1,+ redis_url="redis://localhost:6379/0",+ max_queued_tasks=3,+ )+ from_url.assert_called_once_with("redis://localhost:6379/0")++ def test_enqueue_serializes_video_params_without_mutating_task(self):+ """+ Redis 只能存 JSON;VideoParams 应转换成字典,但原任务仍需保留模型,+ 避免序列化副作用影响日志、重试或调用方后续读取。+ """+ params = VideoParams(video_subject="Coffee")+ task = {+ "func": task_service.start,+ "args": (),+ "kwargs": {"task_id": "task-1", "params": params},+ }++ self.manager.enqueue(task)++ self.assertIs(task["kwargs"]["params"], params)+ queue_name, payload = self.redis_client.rpush.call_args.args+ decoded = json.loads(payload)+ self.assertEqual(queue_name, "task_queue")+ self.assertEqual(decoded["func"], "start")+ self.assertEqual(decoded["kwargs"]["task_id"], "task-1")+ self.assertEqual(decoded["kwargs"]["params"]["video_subject"], "Coffee")++ def test_dequeue_restores_function_and_video_params(self):+ """从 Redis 取出的任务应恢复可调用函数和 VideoParams 模型。"""+ payload = {+ "func": "start",+ "args": [],+ "kwargs": {+ "task_id": "task-1",+ "params": VideoParams(video_subject="Coffee").model_dump(+ warnings=False+ ),+ },+ }+ self.redis_client.lpop.return_value = json.dumps(payload)++ task = self.manager.dequeue()++ self.redis_client.lpop.assert_called_once_with("task_queue")+ self.assertIs(task["func"], task_service.start)+ self.assertIsInstance(task["kwargs"]["params"], VideoParams)+ self.assertEqual(task["kwargs"]["params"].video_subject, "Coffee")++ def test_empty_queue_and_size_use_redis_length(self):+ """队列判空和长度必须直接反映 Redis 当前列表长度。"""+ self.redis_client.lpop.return_value = None+ self.redis_client.llen.side_effect = [0, 2]++ self.assertIsNone(self.manager.dequeue())+ self.assertTrue(self.manager.is_queue_empty())+ self.assertEqual(self.manager.queue_size(), 2)+++if __name__ == "__main__":+ unittest.main()diff --git a/test/services/test_upload_post.py b/test/services/test_upload_post.pyindex 032c856d..6c761800 100644--- a/test/services/test_upload_post.py+++ b/test/services/test_upload_post.py@@ -3,6 +3,8 @@ import unittestfrom pathlib import Pathfrom unittest.mock import MagicMock, mock_open, patch+import requests+sys.path.insert(0, str(Path(__file__).parent.parent.parent))from app.services.upload_post import UploadPostService@@ -40,8 +42,65 @@ def _has_key(data, key):return any(k == key for k, v in data)-class TestUploadPostYouTube(unittest.TestCase):+class TestUploadPostService(unittest.TestCase):+ @patch(+ "app.services.upload_post.config.app",+ {**_CONFIG_BASE, "upload_post_enabled": False},+ )+ @patch("app.services.upload_post.requests.post")+ def test_unconfigured_service_skips_request(self, mock_post):+ """功能未启用时不能意外上传文件或消耗第三方 API 配额。"""+ result = UploadPostService().upload_video("/fake/v.mp4", "Title")++ self.assertFalse(result["success"])+ self.assertIn("not configured", result["error"])+ mock_post.assert_not_called()++ @patch("app.services.upload_post.config.app", _CONFIG_BASE)+ @patch("app.services.upload_post.os.path.exists", return_value=False)+ @patch("app.services.upload_post.requests.post")+ def test_missing_video_skips_request(self, mock_post, _exists):+ """本地成片不存在时应在发起网络请求前返回明确错误。"""+ result = UploadPostService().upload_video("/missing/v.mp4", "Title")+ self.assertFalse(result["success"])+ self.assertIn("Video file not found", result["error"])+ mock_post.assert_not_called()++ @patch("app.services.upload_post.config.app", _CONFIG_BASE)+ @patch("app.services.upload_post.os.path.exists", return_value=True)+ @patch("builtins.open", mock_open(read_data=b"fake"))+ @patch("app.services.upload_post.requests.post")+ def test_upload_request_error_returns_failure(self, mock_post, _exists):+ """网络异常需要转换为稳定结果,不能让发布失败中断视频生成任务。"""+ mock_post.side_effect = requests.exceptions.Timeout("upload timed out")++ result = UploadPostService().upload_video("/fake/v.mp4", "Title")++ self.assertFalse(result["success"])+ self.assertIn("upload timed out", result["error"])++ @patch("app.services.upload_post.config.app", _CONFIG_BASE)+ @patch("app.services.upload_post.requests.get")+ def test_check_status_returns_payload_or_network_failure(self, mock_get):+ """状态查询成功和失败应使用与上传接口一致的返回约定。"""+ response = _mock_response()+ response.json.return_value = {"success": True, "status": "processing"}+ mock_get.return_value = response+ service = UploadPostService()++ self.assertEqual(+ service.check_status("request-123"),+ {"success": True, "status": "processing"},+ )++ mock_get.side_effect = requests.exceptions.ConnectionError("offline")+ failed = service.check_status("request-123")+ self.assertFalse(failed["success"])+ self.assertIn("offline", failed["error"])+++class TestUploadPostYouTubePayload(unittest.TestCase):@patch("app.services.upload_post.config.app", _CONFIG_BASE)@patch("app.services.upload_post.os.path.exists", return_value=True)@patch("builtins.open", mock_open(read_data=b"fake"))diff --git a/test/services/test_video.py b/test/services/test_video.pyindex ba5da081..4ba07a6e 100644--- a/test/services/test_video.py+++ b/test/services/test_video.py@@ -1,98 +1,43 @@--import unittestimport osimport shutilimport sysimport tempfileimport types+import unittestfrom contextlib import redirect_stdoutfrom io import StringIOfrom pathlib import Pathfrom unittest.mock import patch+from moviepy import (ImageClip,VideoFileClip,)+# add project root to python pathsys.path.insert(0, str(Path(__file__).parent.parent.parent))+from app.config import config-from app.controllers.manager.base_manager import TaskQueueFullError-from app.controllers.manager.memory_manager import InMemoryTaskManager-from app.controllers.v1 import video as video_controller-from app.models import constfrom app.models.schema import MaterialInfo-from app.services import state as smfrom app.services import video as vdfrom app.utils import utilsresources_dir = os.path.join(os.path.dirname(os.path.dirname(__file__)), "resources")-class _FakeRequest:- def __init__(self):- self.headers = {"x-task-id": "test-request"}---class TestSecurityControls(unittest.TestCase):- def setUp(self):- self.original_app_config = dict(config.app)-- def tearDown(self):- config.app.clear()- config.app.update(self.original_app_config)-- def test_task_query_returns_relative_task_url_without_mutating_state(self):- """- endpoint 未显式配置时,任务查询接口不能使用 Host 派生绝对 URL,- 也不能把展示 URL 回写到任务状态里,否则不同 Host 查询会污染结果。- """- task_id = "security-task-url"- task_dir = utils.task_dir(task_id)- video_path = os.path.join(task_dir, "final-1.mp4")- Path(video_path).write_bytes(b"fake-video")- config.app["endpoint"] = ""-- try:- sm.state.update_task(- task_id,- state=const.TASK_STATE_COMPLETE,- videos=[video_path],- combined_videos=[video_path],- )-- response = video_controller.get_task(_FakeRequest(), task_id=task_id)-- self.assertEqual(response["data"]["videos"], [f"/tasks/{task_id}/final-1.mp4"])- self.assertEqual(sm.state.get_task(task_id)["videos"], [video_path])- finally:- sm.state.delete_task(task_id)- shutil.rmtree(task_dir, ignore_errors=True)-- def test_in_memory_task_manager_rejects_when_queue_is_full(self):- """- 并发数用尽后,等待队列必须有硬上限。这里用 max_concurrent_tasks=0- 强制任务进入队列,验证超过 max_queued_tasks 时会拒绝继续入队。- """- manager = InMemoryTaskManager(max_concurrent_tasks=0, max_queued_tasks=1)-- manager.add_task(lambda: None)-- with self.assertRaises(TaskQueueFullError):- manager.add_task(lambda: None)-class TestVideoService(unittest.TestCase):def setUp(self):self.original_app_config = dict(config.app)self.test_img_path = os.path.join(resources_dir, "1.png")vd._runtime_disabled_video_codecs.clear()vd._ffmpeg_encoder_exists.cache_clear()-+def tearDown(self):config.app.clear()config.app.update(self.original_app_config)vd._runtime_disabled_video_codecs.clear()vd._ffmpeg_encoder_exists.cache_clear()-+def test_preprocess_video(self):if not os.path.exists(self.test_img_path):self.fail(f"test image not found: {self.test_img_path}")diff --git a/test/services/test_video_effects.py b/test/services/test_video_effects.pyindex 48c3f7bc..69d18434 100644--- a/test/services/test_video_effects.py+++ b/test/services/test_video_effects.py@@ -35,6 +35,81 @@ def _detail_frame(width=128, height=96):).astype(np.uint8)+class TestFadeAndSlideTransitions(unittest.TestCase):+ def test_fade_transitions_apply_requested_duration(self):+ """淡入淡出必须把调用方传入的时长原样交给 MoviePy effect。"""+ clip = _gradient_clip()+ self.addCleanup(clip.close)++ fade_in = video_effects.fadein_transition(clip, 0.25)+ fade_out = video_effects.fadeout_transition(clip, 0.75)+ self.addCleanup(fade_in.close)+ self.addCleanup(fade_out.close)++ self.assertEqual(fade_in.duration, clip.duration)+ self.assertEqual(fade_out.duration, clip.duration)+ frame_difference = np.abs(+ fade_in.get_frame(0).astype(int) - clip.get_frame(0).astype(int)+ )+ self.assertGreater(+ frame_difference.max(),+ 0,+ )+ np.testing.assert_allclose(+ fade_out.get_frame(0),+ clip.get_frame(0),+ atol=1,+ )++ def test_slidein_positions_cover_all_directions_and_unknown_side(self):+ """滑入动画的四个方向、结束位置和未知方向兜底都应保持稳定。"""+ clip = _gradient_clip(width=60, height=40, duration=2)+ self.addCleanup(clip.close)+ expected_starts = {+ "left": (-60, 0),+ "right": (60, 0),+ "top": (0, -40),+ "bottom": (0, 40),+ "unknown": (0, 0),+ }++ for side, expected_start in expected_starts.items():+ with self.subTest(side=side):+ transitioned = video_effects.slidein_transition(clip, 1, side)+ self.addCleanup(transitioned.close)+ moving_clip = transitioned.clips[1]+ self.assertEqual(moving_clip.pos(0), expected_start)+ self.assertEqual(moving_clip.pos(1), (0, 0))++ def test_slideout_positions_cover_timing_and_all_directions(self):+ """+ 滑出应在片段尾部才开始运动;四个方向、超过结束时间和零时长参数+ 都需要被夹紧,避免出现除零或素材提前离场。+ """+ clip = _gradient_clip(width=60, height=40, duration=2)+ self.addCleanup(clip.close)+ expected_ends = {+ "left": (-60, 0),+ "right": (60, 0),+ "top": (0, -40),+ "bottom": (0, 40),+ "unknown": (0, 0),+ }++ for side, expected_end in expected_ends.items():+ with self.subTest(side=side):+ transitioned = video_effects.slideout_transition(clip, 1, side)+ self.addCleanup(transitioned.close)+ moving_clip = transitioned.clips[1]+ self.assertEqual(moving_clip.pos(0.5), (0, 0))+ self.assertEqual(moving_clip.pos(2.5), expected_end)++ zero_duration = video_effects.slideout_transition(clip, 0, "right")+ self.addCleanup(zero_duration.close)+ self.assertEqual(zero_duration.clips[1].pos(2), (0, 0))+ self.assertEqual(zero_duration.clips[1].pos(2.1), (60, 0))++class TestZoomTransitions(unittest.TestCase):def test_schema_has_zoom_members(self):self.assertEqual(VideoTransitionMode.zoom_in.value, "ZoomIn")diff --git a/test/services/test_voice.py b/test/services/test_voice.pyindex 50a56710..46b32e7d 100644--- a/test/services/test_voice.py+++ b/test/services/test_voice.py@@ -1,6 +1,7 @@import asyncioimport base64import os+import shutilimport unittestimport sysimport tempfile@@ -401,7 +402,8 @@ class TestVoiceService(unittest.TestCase):"""验证 Gemini TTS 在 edge_tts 7.x 环境下仍会返回项目兼容的字幕结构,并且可以被 `subtitle_provider=edge` 的字幕生成链路直接消费,- 避免再次回退 Whisper。+ 避免再次回退 Whisper。同时使用不存在的嵌套输出目录,覆盖 API 或+ CLI 直接调用服务时没有提前创建任务目录的边界情况。"""class _InlineData:@@ -448,10 +450,15 @@ class TestVoiceService(unittest.TestCase):def __exit__(self, exc_type, exc_value, traceback):captured["closed"] = True- voice_file = f"{temp_dir}/tts-gemini-Zephyr.mp3"- subtitle_file = f"{temp_dir}/tts-gemini-Zephyr.srt"+ temp_root = Path(tempfile.mkdtemp(prefix="gemini-tts-output-"))+ self.addCleanup(shutil.rmtree, temp_root, True)+ output_dir = temp_root / "nested" / "audio"+ voice_file = str(output_dir / "tts-gemini-Zephyr.mp3")+ subtitle_file = str(output_dir / "tts-gemini-Zephyr.srt")text = "Gemini subtitle generation should work now. Testing multiple lines."+ self.assertFalse(output_dir.exists())+with patch("google.genai.Client", _FakeClient), patch.object(vs.config,"app",@@ -465,6 +472,7 @@ class TestVoiceService(unittest.TestCase):)self.assertIsNotNone(sub_maker)+ self.assertTrue(Path(voice_file).is_file())self.assertEqual(getattr(sub_maker, "subs", []),["Gemini subtitle generation should work now", "Testing multiple lines"],diff --git a/test/test_main.py b/test/test_main.pynew file mode 100644index 00000000..c98331a1--- /dev/null+++ b/test/test_main.py@@ -0,0 +1,30 @@+import runpy+from pathlib import Path+from unittest.mock import patch++from app.config import config+++ROOT_DIR = Path(__file__).resolve().parent.parent+++def test_main_starts_uvicorn_with_runtime_config():+ """+ 服务启动入口只负责把运行配置交给 Uvicorn。这里 mock 真正的服务器启动,+ 既避免测试占用端口,也确认监听地址、端口和热重载配置不会在入口层丢失。+ """+ with (+ patch.object(config, "listen_host", "127.0.0.1"),+ patch.object(config, "listen_port", 8765),+ patch.object(config, "reload_debug", True),+ patch("uvicorn.run") as run_server,+ ):+ runpy.run_path(str(ROOT_DIR / "main.py"), run_name="__main__")++ run_server.assert_called_once_with(+ app="app.asgi:app",+ host="127.0.0.1",+ port=8765,+ reload=True,+ log_level="warning",+ )diff --git a/uv.lock b/uv.lockindex 47fdb791..22403977 100644--- a/uv.lock+++ b/uv.lock@@ -541,6 +541,90 @@ wheels = [{ url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335 },]+[[package]]+name = "coverage"+version = "7.15.1"+source = { registry = "https://pypi.org/simple" }+sdist = { url = "https://files.pythonhosted.org/packages/4a/83/6051c2a2feab48ae5bd27c84ef047191d2d4a3172f689e38eaa48ed17db1/coverage-7.15.1.tar.gz", hash = "sha256:165e9949eaf222ef1f018635d0d7f368a23bfe0212af558534c40d8c04686d67", size = 927640 }+wheels = [+ { url = "https://files.pythonhosted.org/packages/67/ee/5095e07a0986930174fc153fd0bb115f7f2724f5344cc672e016d4f23a4e/coverage-7.15.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:6506330b4a8dcf53b95bd84d8d0e817107cdb3fc1438e835029cdf0bc6612eb0", size = 221320 },+ { url = "https://files.pythonhosted.org/packages/43/7a/7e2598ce98433a214020a61c0755d5961f9f26df0c630dc73e06b86d3416/coverage-7.15.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f8a51a8ec382c39d939cba0ab07ae949077ae4e842343bd4eed22d432358cea9", size = 221823 },+ { url = "https://files.pythonhosted.org/packages/8b/4f/67dac6a69139b490a239d91b6d5ef127982ffb89159769241656ab879ee5/coverage-7.15.1-cp311-cp311-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:18ea20e3922d7f8ca9e0ef1084408d08c4ad62d5e531cb9c1f6896a99297ebea", size = 252242 },+ { url = "https://files.pythonhosted.org/packages/05/37/5e439725a96de592309725550c8df639c359c209dcb4b152ed46032d4c0d/coverage-7.15.1-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:aab9902a64b8390e3b56e539fddae1d79a267807fe5cb0c18d7d2f544ce867e2", size = 254153 },+ { url = "https://files.pythonhosted.org/packages/0f/1c/671ba9e15f9651a99962fb588a1fe4fb267cae4bb85f9bb4ac4413c6f7ef/coverage-7.15.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8cc316264317b07a9e90d7f2b4188a15e36e9b54e651081b791b0515fa612a29", size = 256261 },+ { url = "https://files.pythonhosted.org/packages/d6/3c/88305322b4d015b4536b7174b8f9b87f850f01af9d89008cdbf984b65ff2/coverage-7.15.1-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:d4e47e7eea81a8ccf060a07627654151d929da62c7b715738387c200905cec89", size = 258222 },+ { url = "https://files.pythonhosted.org/packages/8d/20/d02e42333a57f266ded61ed4fb3821da1f2dc143734aaa3dcc9c117204c5/coverage-7.15.1-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:c6829d9a3b55ad2b73ef5fda8302e5be03683789e88b1a079dcf4a773229c21d", size = 252368 },+ { url = "https://files.pythonhosted.org/packages/f3/d0/94ebc010926a191d83e83b1f1236f8bd0d14d0eb98b5c324aa4be2589a8e/coverage-7.15.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:764e045811f9c8cda436641f3f088283351d331a519b5807f19041cd0a68da1c", size = 253953 },+ { url = "https://files.pythonhosted.org/packages/2e/a6/2c8553191da0c2da2c43ff294fb9bab57a5b0fae03560304a82a8b5addc3/coverage-7.15.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:09b3b088aa24489c4082bcc35fcc8224281ab94a653dfb6d3f0c8165b0d628ab", size = 252016 },+ { url = "https://files.pythonhosted.org/packages/17/99/20f47986d8360fa1a31d9858dd2ba0be009d44ecfa8d02120b1eb93c028b/coverage-7.15.1-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:7911b02f57053adf8164ae63edb1c26574d24dfccabadc5268cf69310a69a358", size = 255783 },+ { url = "https://files.pythonhosted.org/packages/17/36/fb61983b5259f78fa5e62ee74e91fe4de4c556fcbc9a3b9c9021c2f8b57b/coverage-7.15.1-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:664e279ed40599b8ed16f4db18d92a7e212c73129672bec8f5d96d4da48d2404", size = 251735 },+ { url = "https://files.pythonhosted.org/packages/6c/2e/d109d8d2d6c726ba2e78125297073918a2a91464f0ea777e5398fa3cf75c/coverage-7.15.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:34fe7cf79d5f1f87f2e8ce7dc1c32950841f50e10d0120f263856acfad66de34", size = 252645 },+ { url = "https://files.pythonhosted.org/packages/bc/a0/5b3219cbb46135e14673427f2bf5890c4da4e6f655243692f3448aa3f42c/coverage-7.15.1-cp311-cp311-win32.whl", hash = "sha256:5e2d2536d2f57a354aa382ed303ac0e2e5c9522a508c05b998d26181b94163a7", size = 223414 },+ { url = "https://files.pythonhosted.org/packages/5b/80/24e13ade0b6df8090e2492f9c55044bf1423f7ef28c76fc1af8c827a61cb/coverage-7.15.1-cp311-cp311-win_amd64.whl", hash = "sha256:c337da8fca7ea93ab43f3868cfcde6cf6dad32c3906b273cfbad5d7390bc423b", size = 223888 },+ { url = "https://files.pythonhosted.org/packages/2d/9e/34659930ae380491af48e2f5f5f9a2e99cd9fb7de3d30f27be5ac5425137/coverage-7.15.1-cp311-cp311-win_arm64.whl", hash = "sha256:db3403fdb7a94d5eb73e099befad8104d2a7d110a0f0d99df0de61c5d1fa756c", size = 223435 },+ { url = "https://files.pythonhosted.org/packages/d9/76/32c1826309beaf4604c54accef108fdd611e5e5e93f2f5192f050cd5f6bd/coverage-7.15.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d9476292594309db922cc841dd13b303b3c388f4c25d279884f7e2341c681f80", size = 221497 },+ { url = "https://files.pythonhosted.org/packages/db/5c/b88ce0d68fa550c7f3b58617fbf363bce64df5bf8295a01b627e4696e022/coverage-7.15.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:0c579056b0de461b3a62318b63d0b6ce90aed7f8158d3f00da094df82f29d189", size = 221854 },+ { url = "https://files.pythonhosted.org/packages/0e/fe/8509fd2a66fc4e0a829f76a0f0b1dc3cc163368352435b5f243168658077/coverage-7.15.1-cp312-cp312-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:23214bdbe226f2b0e9c66a7d6a1d59d4a88045dcf86e702cf0fe0d0935e3d615", size = 253359 },+ { url = "https://files.pythonhosted.org/packages/e5/81/c7009ed7ea9765adb2b9d095054d748266fae5f07ac6c5f925f33715fcde/coverage-7.15.1-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:df164be93b46b4825cc39339440a05edc54c4d1d865ba4a60fd43d151a2a1cd3", size = 256096 },+ { url = "https://files.pythonhosted.org/packages/21/52/dc8ee03968a5ba86e2da5aa48ddc9e3747bd65d63825fdce2d96acb9c5ff/coverage-7.15.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a524fca1a6f08927d9dc2d4c873cfb7bd7202c247f08b14bdc02424071b8b304", size = 257211 },+ { url = "https://files.pythonhosted.org/packages/b8/27/95d7623908da8937deb53d48efcdbf423907a47540e63c62fa21372c652b/coverage-7.15.1-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:d70f3542cd38de85a9e257dcb1ac4c1ab4b6d7d2c2a645809207556628755d1c", size = 259473 },+ { url = "https://files.pythonhosted.org/packages/f1/3b/730d761928de97d585465680b568ae69622fb40716babadeabffe75cb51b/coverage-7.15.1-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:d78aa537237212c4313aabe5e964b66acc86350ed19ebc56a3e202df33b6077b", size = 253759 },+ { url = "https://files.pythonhosted.org/packages/f1/fc/6b9277acff1f9484b6c12857af5774689d1a6a95e13265f7405329d2f5da/coverage-7.15.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:a318112bb4f79d9d04766196d5a3388caa825908a6a9b052aa87de3d9aea7c61", size = 255131 },+ { url = "https://files.pythonhosted.org/packages/3d/f2/c704f86129594ba34e25a64695d2068c71d51c2b98907184d716c94f4aec/coverage-7.15.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:e55d24cada901963eed5bc89fa562aa033f0d84b9d3de4ecf363737c13aed11e", size = 253275 },+ { url = "https://files.pythonhosted.org/packages/f6/29/80fee8af47de4a6dce71ccf2938491f444687a756af258a56d8469b8f1b0/coverage-7.15.1-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:3c78f0cea7275342cf2adc2ad5fdd0aafa106ad91e66d573568f2fcf62c41df5", size = 257345 },+ { url = "https://files.pythonhosted.org/packages/20/21/a1e7d7ed1b48a8adf8fd5154d9e83fcc5ad8e6ff20ae00e44865057dce8d/coverage-7.15.1-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:86bd37eabe39977216f630a7fc1b698e7f5e81a191c7186013245c6c3d313f9d", size = 252844 },+ { url = "https://files.pythonhosted.org/packages/a7/8c/a4bc26e6ee207d412f3678f04d74be1550e83140563ca0e4997510579712/coverage-7.15.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:c6db15c217693bdc3ca0b84de1ba9afafe1c14c26a8a29d77f4ed0de2b6132e2", size = 254716 },+ { url = "https://files.pythonhosted.org/packages/11/9d/8ad0266ecfada6353cf6627a1a02294cf55a907521b6ee0bd7b770cfd659/coverage-7.15.1-cp312-cp312-win32.whl", hash = "sha256:359f3fbe09a51500c51966596ee4ee4070b356552c70b3b2420eb200d68e0f76", size = 223554 },+ { url = "https://files.pythonhosted.org/packages/81/6d/24224929e06c6e05a93f738bc5f9e8e6ab658f8f1d9b823e7b85430e28b8/coverage-7.15.1-cp312-cp312-win_amd64.whl", hash = "sha256:fa75dc099c126e941a9c0baa8ebd2cbc78bd778687534fe410baf754f6d9e374", size = 224087 },+ { url = "https://files.pythonhosted.org/packages/35/23/f81441dd01de88e53c97842e706907b307d9078918c3f4998b11e9ac7250/coverage-7.15.1-cp312-cp312-win_arm64.whl", hash = "sha256:26f89cf6d0634375f454fa71057945ad18edb0f1607a90fecf22c57dc3dc289a", size = 223472 },+ { url = "https://files.pythonhosted.org/packages/ca/1e/6fa289d7993a2a39f1b283ddb58c4bfec80f7800be654b8ba8a9f6a07c63/coverage-7.15.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:71ac4ca1658ca99160fd58cc6967110e989c34b04627f24ed6ec9f70fb24571a", size = 221519 },+ { url = "https://files.pythonhosted.org/packages/6f/e1/0db4902a0588234a70ab0218073c0b20fbc5c740aa35f91d360160a2ebc9/coverage-7.15.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:26a40cbf2b13bd94af53ee02a424cb3bb96a9edfac0d00834bd068512a62714b", size = 221895 },+ { url = "https://files.pythonhosted.org/packages/b4/cb/3719783865092dac5e08df842730305ee9ab1973ae7ddb6fbdf27d401f30/coverage-7.15.1-cp313-cp313-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:f4c5a5eff4ad4f9f7088fd3fc7a66d98d06566ee294b3b053309fb0a3b45be1e", size = 252882 },+ { url = "https://files.pythonhosted.org/packages/1c/5e/caf3abbdbb22629626160ffc9c017eb995b7cb11c0be46b974834cef1792/coverage-7.15.1-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:962aa56c1c9b016d681265880eb6acc9966029d2c4c559319cc43a1abbb9b59a", size = 255479 },+ { url = "https://files.pythonhosted.org/packages/d6/f1/d60f375bfe095fef944f0f19427aefdbf9bdd5a9571c41a4bf6e2f5fdb81/coverage-7.15.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1678eb2dc57a8ce67601b029582ef6d41e9e6ca22692aaeccd4107e40f27386c", size = 256715 },+ { url = "https://files.pythonhosted.org/packages/d7/17/8b0cbc90d02dc5adad4d9034c1824ec3fa567771b4c39d9c1e3f9b1431b8/coverage-7.15.1-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:1174900a43f6f8c425fee10d7dbddc308adefcdc78aaced32357f5ab750a0e90", size = 258845 },+ { url = "https://files.pythonhosted.org/packages/92/29/c5e69f5fb75c322e9a3e4ef64d02eebfc3d66efceccc8514ff80a3c13a56/coverage-7.15.1-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:98847557a6859cadf693792ce89f440cb89692993f60dc6d3a7e35f3d340216f", size = 253098 },+ { url = "https://files.pythonhosted.org/packages/64/57/21144252fdd0c01d707d48fbcea13a80b0b7c42ced3f299f885ab8978c3a/coverage-7.15.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:8697b2edb57143546a24389efc11e1b000cd5800fc20d84f04edb601e4a7cfb8", size = 254844 },+ { url = "https://files.pythonhosted.org/packages/59/2a/499a28a322b0ce6768328e6c5bb2e2ad00ac068a7c7adb2ecd8533c8c5d9/coverage-7.15.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:6827ac0519be3fe91bf96b4060eb00d1d24f82649b29862cd75a3cfca248b02a", size = 252807 },+ { url = "https://files.pythonhosted.org/packages/2c/6f/928a95da5da8b60f2b00e1482c7787b3316188e6d2d227fb8e124ada43a1/coverage-7.15.1-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:2de8ecbbc77c7e4d22572779920ed8979c69168675e96be3a548c996568c6c31", size = 256965 },+ { url = "https://files.pythonhosted.org/packages/16/10/889adbc1b8c9f866ed51e18a98bcafc0259fb9d29b81f50a719407c64ea8/coverage-7.15.1-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:2b25f0f0fa5260df9d7bb55d47c8bdc23fa3382c1a18f7c9cae122e6c320b1ad", size = 252628 },+ { url = "https://files.pythonhosted.org/packages/1a/30/a5e1871e5d93416511f8e359d1ccebfe0cbb050a1bbf7dd20228533ec0cf/coverage-7.15.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:4a2effcbd93ae340a58db718fe4181d967f84d352c4cefeaab4ff82ce813901a", size = 254399 },+ { url = "https://files.pythonhosted.org/packages/2d/26/c36fbffd549dadbdd1a75827528fb00a4c46aa3187b007b750b1e2cebbf2/coverage-7.15.1-cp313-cp313-win32.whl", hash = "sha256:895e65c96aef0cecea250f6e35e9a32f11375514e1a0cb5210e0fda128c04e8e", size = 223564 },+ { url = "https://files.pythonhosted.org/packages/16/fc/becbb9d2c4206d242b9b1e1e8e24a42f7926c0200dd3c788b9fab4bb96d5/coverage-7.15.1-cp313-cp313-win_amd64.whl", hash = "sha256:f6d0a28b63a0d75f9ed5118105d1154fc3aa40a8605a30d5d87e3d043ad90fe7", size = 224106 },+ { url = "https://files.pythonhosted.org/packages/d3/30/1cfc641461369b6858799fca61c0a8b5edc490c519bf7c636ffa6bbf556f/coverage-7.15.1-cp313-cp313-win_arm64.whl", hash = "sha256:b4ee9818e8bae3544379ad2c09b851c4fb886aaa8860d57a1c1316ddcb16db49", size = 223497 },+ { url = "https://files.pythonhosted.org/packages/f0/46/81961952e7aebfb38ad0ae4264e8954cc607a7af9e7ac111f9fa986595cc/coverage-7.15.1-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:a886af95f59edf67d5770fd3564d53f4a8af93f25f8c1d60d27e00d7f5674ee8", size = 221560 },+ { url = "https://files.pythonhosted.org/packages/13/d2/ee14d715889f216baf47301d9f469e08fff6995552aaf67e897b282865f6/coverage-7.15.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:985657ebd707941de90d488d1cbb5efac20bdf81f7b91eba771624ccda4d36f4", size = 221894 },+ { url = "https://files.pythonhosted.org/packages/f3/38/f830bc6e6c2c5f23f43847125e6c650d378872f7eeba8d49f1d42193e8a9/coverage-7.15.1-cp314-cp314-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:5bbe2a06e0a5e1404d9ffbdb49b819bbd6a3bb198ebea4c8dfe7ad9f1e1c2e81", size = 252938 },+ { url = "https://files.pythonhosted.org/packages/e1/53/0d3dd963631259d794c898735d5436e68d6a8d40749c419a07ff7c171469/coverage-7.15.1-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:bde0fe24083d0b7b3dbafa7a09f0796410af1afa2523f28f5f208d8340a4aaca", size = 255445 },+ { url = "https://files.pythonhosted.org/packages/b1/fd/aabed228557565c958259251b89bab8c5669b31291fa63b3e2154ebb017a/coverage-7.15.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f89f7453d6d46db14cf233e2cd8edcd78de2b9c49d4f1dc109590b4e5dbfbb74", size = 256790 },+ { url = "https://files.pythonhosted.org/packages/bc/aa/1cc888e5d3623e603c4e5399653cb25728bb2b40d7519188a3e293d24620/coverage-7.15.1-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:cc3656c9ecc27b36bd0907455b77f83c0069ca9ad4a66dec892b76c696eb6047", size = 259104 },+ { url = "https://files.pythonhosted.org/packages/5f/61/fc16d5f5e53098dae41efa21e8ccc611a9b4fe922750dd03dc56db552182/coverage-7.15.1-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:24d8e85a2a45e44883b488c2659f51fa761dad5353fdb319b672a93facbd2ca9", size = 252956 },+ { url = "https://files.pythonhosted.org/packages/a1/f3/52384668c3de4519ca770bf1975a89e4d6eb5aa2faf0da0577a14008cba4/coverage-7.15.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:68931b5fe746ed4fdaa8892989cab9e6c35781eeb3b0ab2ded893d561e1b3652", size = 254797 },+ { url = "https://files.pythonhosted.org/packages/ce/68/54b807e7c1868178e902fd8360b5d4e559394462f97285c50edf1c4608db/coverage-7.15.1-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:1ce6947e2a95534ecaa5a15e73c21e550514c980d80eda204d064d789a95f6a4", size = 252762 },+ { url = "https://files.pythonhosted.org/packages/7b/48/dde8adf0338e3ace738757dccf1ce817e5fdcadfae77e1b48a77e5a3b265/coverage-7.15.1-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:841befdbc89b9c82435fc25b0f4f41858b6238693e45af758bec4cfc1968171c", size = 257037 },+ { url = "https://files.pythonhosted.org/packages/07/f2/179dd88cf60a0aeeee16a970ffe250dccea8b80ed4beab4c5d3f6c41ad4b/coverage-7.15.1-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:5d3de58b837375e7f4c0e1a088ccab5f655efb2fd7427b729df02c862a559633", size = 252577 },+ { url = "https://files.pythonhosted.org/packages/2c/37/8a593d69ab521beb6a105a2017cac4ba94425ee0a8349e29c3c0b522d24f/coverage-7.15.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:b1801963f9f44ae0c0f6d737bc7aeb2bbcde7d1fe7e3b43cddc1961af42d3b41", size = 254235 },+ { url = "https://files.pythonhosted.org/packages/6d/34/bc9b3bced66f2cdad4bf5e57ae51c54ea226e8aaaebfc9370a9a11877bf3/coverage-7.15.1-cp314-cp314-win32.whl", hash = "sha256:8c7953c4128ef53b6ffb5f90d87c87d4ce26731df294760bb2314eb0e069e44b", size = 223771 },+ { url = "https://files.pythonhosted.org/packages/4c/f3/4d20337bed61915d14349e62b88d5e4144d5a9872b64adbe90e9906db6db/coverage-7.15.1-cp314-cp314-win_amd64.whl", hash = "sha256:6f0bab60a582d415f0fb535ccff13ba334a47a1538f98913330a525d23bd535a", size = 224257 },+ { url = "https://files.pythonhosted.org/packages/7b/df/bbfeae4948f3ded516f92b32f2d57952427fc5ecfc0924487bb6ee6a5f38/coverage-7.15.1-cp314-cp314-win_arm64.whl", hash = "sha256:0f410ee8f0ac4ec7db71bc0b7632a8b9994e1cad2755bd1566c17e6a162caa74", size = 223683 },+ { url = "https://files.pythonhosted.org/packages/35/65/0b431856064e387d1f5cf474625e4a0465e907024d42f35de6af19ced0be/coverage-7.15.1-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:fc868bab88e049d41fcd41766810d790a8b960053be2a45e060f5ce0d31d258b", size = 222298 },+ { url = "https://files.pythonhosted.org/packages/a6/96/50eac9bd49df8a3df5f3d38746d1bf332299dffb554486c94ebd55c9dc49/coverage-7.15.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:206d4ec6028f2773b40932d09f074539d6bcdd8f6b318d40cb04bdbd68ed0b49", size = 222561 },+ { url = "https://files.pythonhosted.org/packages/e0/5b/6ba1c4a27e10b8816fd2622b98162c83d3bdf1185097360373611bf96364/coverage-7.15.1-cp314-cp314t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:620482ef1c9f4e61f962e159325fe77dea59d16e39d9c9470d069053b244d864", size = 263923 },+ { url = "https://files.pythonhosted.org/packages/e4/59/fe03ade97a3ca2d890e98c572cf48a99fda9adba85757c34b823f41efe1e/coverage-7.15.1-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:d385fc9b054e309ad3cecdc77b586d2af0c98aeec2fdb3773544586f366e817c", size = 266043 },+ { url = "https://files.pythonhosted.org/packages/16/e0/55c4b1217a572a43e13b39e1eb78d0da29fb23679003bd0cdf22c50b1978/coverage-7.15.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f1198bca9c0dd7c188aae1f185b0c0b5fc4f0a2b6909000858c29550320bdb07", size = 268465 },+ { url = "https://files.pythonhosted.org/packages/b1/e2/ee47944f76afc03909119b036fe9e0da8cbd274a5141287de79791a0fb6d/coverage-7.15.1-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:5d0297e6a070eadb49df7cddd0ab6f420b8b689dd8904c7dd815a323168fa57e", size = 269584 },+ { url = "https://files.pythonhosted.org/packages/cb/8a/6b4d9779c7b2e21c3d12c3425e3261aa7411399319e27aa402dfec4db5d0/coverage-7.15.1-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:916fcf2214f56960e409561b37fc32a160a42b6e85483d0652d7b70fa55d707e", size = 263019 },+ { url = "https://files.pythonhosted.org/packages/c4/1e/db5c7fa0c8ba5ece390a1e1a3f30db71d440240a80589df28e66a7503c40/coverage-7.15.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:f837bae572c7869ffaa502e604c87e182543012831cf87aae4586ad090ac6dcf", size = 265916 },+ { url = "https://files.pythonhosted.org/packages/83/53/fe5176682b00709b13fab36addd26883139d0dea430816fea412e69255e2/coverage-7.15.1-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:3ea65e3ee6c7c32349fd00559927a9e577bdd72386087eeed1c42b62dfce9b82", size = 263520 },+ { url = "https://files.pythonhosted.org/packages/f9/e7/16f15127be93fbc70c667df5ec5dce934fc76c9b0888d84969a5d5341e2c/coverage-7.15.1-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:345034976f46a1c54bd17f4e43eb30bb92cb7082fcddff03250cff136cc4eb82", size = 267254 },+ { url = "https://files.pythonhosted.org/packages/cd/73/e5119111f6f065376395a525f7ce6e9174d83f3db6d217ea0211a61cca4d/coverage-7.15.1-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:4f051a64eb8f8addb4661c2b41d6eea5b7ebc68ad4b2baea8d9bc54e1956e5f7", size = 262366 },+ { url = "https://files.pythonhosted.org/packages/d7/9c/6d0a81182df18a73b081e7a8630f0e2a52b12dfd7898c6ab839551a454d2/coverage-7.15.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:a7625770f7720b49bb30d194ad2f8d50fab3c5177874af3d2399676f95f9c594", size = 264680 },+ { url = "https://files.pythonhosted.org/packages/d9/a2/bac0cbd4450638f1be2041a464b1766c8cc94abf705a2df6f1c8d4be870d/coverage-7.15.1-cp314-cp314t-win32.whl", hash = "sha256:81e503d130a472ad1bd38199ecd35116b40d92bcd31e27a2cacde035381f2070", size = 224077 },+ { url = "https://files.pythonhosted.org/packages/f0/b2/d83c5403155172a43ba47c08641bad3f89822d8405102423a41339d2c857/coverage-7.15.1-cp314-cp314t-win_amd64.whl", hash = "sha256:724e878b213b302ad46e9f2fc872d386613f20ebfc492a211482d917ea76c14f", size = 224908 },+ { url = "https://files.pythonhosted.org/packages/cc/41/442b74cad832cc77712080585455482e7cc4f4a9a13192f65731dcd18231/coverage-7.15.1-cp314-cp314t-win_arm64.whl", hash = "sha256:ce2f05c14d077f406fefc4fa5e4f093ad0e0787549f6582535d6e28766f0361b", size = 224219 },+ { url = "https://files.pythonhosted.org/packages/34/98/07a67cf1a26e795d617ed5c540c042b0ac87b72f810c30c07f076cf334f3/coverage-7.15.1-py3-none-any.whl", hash = "sha256:717d01e6e00bed56ad13306f19e0dd2f4f645ee8159d2c72c72301d6cfc7090c", size = 213284 },+]+[[package]]name = "cryptography"version = "49.0.0"@@ -1139,6 +1223,15 @@ wheels = [{ url = "https://files.pythonhosted.org/packages/a0/d9/a1e041c5e7caa9a05c925f4bdbdfb7f006d1f74996af53467bc394c97be7/importlib_metadata-8.5.0-py3-none-any.whl", hash = "sha256:45e54197d28b7a7f1559e60b95e7c567032b602131fbd588f1497f47880aa68b", size = 26514 },]+[[package]]+name = "iniconfig"+version = "2.3.0"+source = { registry = "https://pypi.org/simple" }+sdist = { url = "https://files.pythonhosted.org/packages/72/34/14ca021ce8e5dfedc35312d08ba8bf51fdd999c576889fc2c24cb97f4f10/iniconfig-2.3.0.tar.gz", hash = "sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730", size = 20503 }+wheels = [+ { url = "https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12", size = 7484 },+]+[[package]]name = "itsdangerous"version = "2.2.0"@@ -1435,6 +1528,12 @@ twelvelabs = [{ name = "twelvelabs" },]+[package.dev-dependencies]+dev = [+ { name = "coverage" },+ { name = "pytest" },+]+[package.metadata]requires-dist = [{ name = "audioop-lts", marker = "python_full_version >= '3.13'", specifier = "==0.2.2" },@@ -1461,6 +1560,12 @@ requires-dist = []provides-extras = ["twelvelabs"]+[package.metadata.requires-dev]+dev = [+ { name = "coverage", specifier = "==7.15.1" },+ { name = "pytest", specifier = "==9.1.1" },+]+[[package]]name = "moviepy"version = "2.2.1"@@ -1897,6 +2002,15 @@ wheels = [{ url = "https://files.pythonhosted.org/packages/34/e7/ae39f538fd6844e982063c3a5e4598b8ced43b9633baa3a85ef33af8c05c/pillow-11.3.0-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:c84d689db21a1c397d001aa08241044aa2069e7587b398c8cc63020390b1c1b8", size = 6984598 },]+[[package]]+name = "pluggy"+version = "1.6.0"+source = { registry = "https://pypi.org/simple" }+sdist = { url = "https://files.pythonhosted.org/packages/f9/e2/3e91f31a7d2b083fe6ef3fa267035b518369d9511ffab804f839851d2779/pluggy-1.6.0.tar.gz", hash = "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3", size = 69412 }+wheels = [+ { url = "https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746", size = 20538 },+]+[[package]]name = "proglog"version = "0.1.12"@@ -2245,6 +2359,22 @@ wheels = [{ url = "https://files.pythonhosted.org/packages/f4/7e/a72dd26f3b0f4f2bf1dd8923c85f7ceb43172af56d63c7383eb62b332364/pygments-2.20.0-py3-none-any.whl", hash = "sha256:81a9e26dd42fd28a23a2d169d86d7ac03b46e2f8b59ed4698fb4785f946d0176", size = 1231151 },]+[[package]]+name = "pytest"+version = "9.1.1"+source = { registry = "https://pypi.org/simple" }+dependencies = [+ { name = "colorama", marker = "sys_platform == 'win32'" },+ { name = "iniconfig" },+ { name = "packaging" },+ { name = "pluggy" },+ { name = "pygments" },+]+sdist = { url = "https://files.pythonhosted.org/packages/e4/47/b9efed96c114afcfa3c9d3fe98a76a1d14c74a9e266d397cf6eb64be5e01/pytest-9.1.1.tar.gz", hash = "sha256:1088fbde8f2b49d95a549a195707afa7a76a3ce9bcadc26b6d71f0ffda5fe313", size = 1636369 }+wheels = [+ { url = "https://files.pythonhosted.org/packages/24/25/1de2678b631f5a49215c6c96fff41ba892b0a34df68d6d80292b1b48aa7f/pytest-9.1.1-py3-none-any.whl", hash = "sha256:37a86b45efb9a47a61a36449063e8e18d0cab3161329fc099eb21783169c4f0c", size = 386536 },+]+[[package]]name = "python-dateutil"version = "2.9.0.post0"