feat: editor playback + temp cleanup on close + docs (v1.6)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-02 18:31:13 +02:00
co-authored by Claude Opus 4.8
parent 4d54f29514
commit 4a34a87d37
3 changed files with 90 additions and 2 deletions
+20
View File
@@ -1,3 +1,4 @@
import os
import pytest
# Redirect QSettings to a throwaway dir BEFORE any MainWindow is constructed, so
@@ -729,3 +730,22 @@ def test_editor_undo_redo(win, tmp_path, monkeypatch):
dlg._on_redo(); assert dlg._ver_idx == 1
dlg._on_redo(); assert dlg._ver_idx == 2
dlg._on_redo(); assert dlg._ver_idx == 2 # clamped at top
def test_editor_play_stop_safe(win, tmp_path):
import main as m
src = tmp_path / "v0.wav"; src.write_bytes(b"")
dlg = m.AudioEditorDialog(str(src), parent=win)
dlg._stop_play() # no proc -> safe no-op
assert dlg._btn_play.text() == "▶ Play"
def test_editor_close_cleans_temps(win, tmp_path):
import main as m
src = tmp_path / "v0.wav"; src.write_bytes(b"")
t1 = tmp_path / "t1.wav"; t1.write_bytes(b"x")
dlg = m.AudioEditorDialog(str(src), parent=win)
dlg._temps.add(str(t1))
dlg.close()
assert not t1.exists()
assert os.path.exists(str(src)) # _versions[0] (entry temp) is NOT swept by the editor