import cadence from cadence import Segment, Word def test_generate_combined_transcripts(make_track, tmp_path): td = make_track( name="video.mp4", duration=2.0, timeline=[Segment(0.0, 2.0, "keep")], words=[Word("Hello.", 0.2, 0.5), Word("world.", 0.6, 0.9)], ) out = tmp_path / "captions" cadence.generate_combined_transcripts([td], out) srt = out.with_suffix(".srt") assert srt.exists() assert srt.stat().st_size > 0 llm_transcript = out.with_name(f"{out.stem}_llm_transcript.txt") assert llm_transcript.exists() assert llm_transcript.stat().st_size > 0 # Atomic writes must not leave temp files behind. assert not list(tmp_path.glob("*.tmp"))