Merge branch 'fix/media-error-diagnostics' into fix/community-integration
This commit is contained in:
@@ -2,11 +2,11 @@ import json
|
||||
from types import SimpleNamespace
|
||||
|
||||
import pytest
|
||||
from services import dub_pipeline
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_extract_error_preserves_failure_after_long_banner(tmp_path, monkeypatch):
|
||||
from services import dub_pipeline
|
||||
stderr = ("ffmpeg version configuration " * 100 + "\n/home/private/media/secret.mp4: No audio stream found").encode()
|
||||
async def run_proc(args):
|
||||
return SimpleNamespace(returncode=1), b"", stderr
|
||||
@@ -22,11 +22,13 @@ async def test_extract_error_preserves_failure_after_long_banner(tmp_path, monke
|
||||
|
||||
|
||||
def test_empty_native_diagnostic_retains_exit_code():
|
||||
from services import dub_pipeline
|
||||
assert "code 7" in dub_pipeline._media_process_error("FFmpeg", 7, b"")
|
||||
|
||||
|
||||
@pytest.mark.parametrize("path", ["/mnt/media/private.mp4", "D:\\Media\\private.mp4", "/opt/data/private.mp4"])
|
||||
def test_native_error_redacts_non_home_command_paths(path):
|
||||
from services import dub_pipeline
|
||||
error = dub_pipeline._media_process_error("FFmpeg", 1, (path + ": Permission denied").encode(), paths=(path,))
|
||||
assert path not in error
|
||||
assert "Permission denied" in error
|
||||
|
||||
Reference in New Issue
Block a user