Private
Public Access
Merge branch 'master' of C:\projects\manual_slop into tier2/any_type_componentization_20260621
This commit is contained in:
@@ -43,7 +43,7 @@ def test_extract_transcript_success(tmp_path: Path) -> None:
|
||||
{"start": 0.0, "duration": 5.0, "text": "Hello world"},
|
||||
{"start": 5.0, "duration": 3.0, "text": "Goodbye world"},
|
||||
]
|
||||
with patch("scripts.video_analysis.extract_transcript._fetch_raw_transcript") as mock_fetch:
|
||||
with patch("scripts.video_analysis.extract_transcript._fetch_via_ytdlp") as mock_fetch:
|
||||
mock_fetch.return_value = fake_segments
|
||||
result = extract_transcript("https://youtu.be/ABCDEFGHIJK", tmp_path / "transcript.json")
|
||||
assert result.is_ok()
|
||||
@@ -54,14 +54,14 @@ def test_extract_transcript_success(tmp_path: Path) -> None:
|
||||
|
||||
|
||||
def test_extract_transcript_network_error(tmp_path: Path) -> None:
|
||||
with patch("scripts.video_analysis.extract_transcript._fetch_raw_transcript") as mock_fetch:
|
||||
with patch("scripts.video_analysis.extract_transcript._fetch_via_ytdlp") as mock_fetch:
|
||||
mock_fetch.side_effect = Exception("network unreachable")
|
||||
result = extract_transcript("https://youtu.be/ABCDEFGHIJK", tmp_path / "transcript.json")
|
||||
assert result.is_err()
|
||||
|
||||
|
||||
def test_extract_transcript_retries_then_fails(tmp_path: Path) -> None:
|
||||
with patch("scripts.video_analysis.extract_transcript._fetch_raw_transcript") as mock_fetch:
|
||||
with patch("scripts.video_analysis.extract_transcript._fetch_via_ytdlp") as mock_fetch:
|
||||
mock_fetch.side_effect = Exception("transient")
|
||||
result = extract_transcript("https://youtu.be/ABCDEFGHIJK", tmp_path / "transcript.json", retries=2)
|
||||
assert result.is_err()
|
||||
|
||||
Reference in New Issue
Block a user