feat(gui): échec amont clair si dossier de sortie non inscriptible (P1-6)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -197,6 +197,23 @@ def test_progress_callbacks(tmp_path):
|
||||
assert (2, 2) in events # progression finale atteinte
|
||||
|
||||
|
||||
def test_run_fails_fast_when_output_not_writable(tmp_path, monkeypatch):
|
||||
from gui_v6.processing_runner import ProcessingRunner, OutputNotWritableError
|
||||
src = tmp_path / "in"
|
||||
src.mkdir()
|
||||
(src / "a.txt").write_text("x", encoding="utf-8")
|
||||
out = tmp_path / "ro"
|
||||
out.mkdir()
|
||||
|
||||
def boom(*a, **k):
|
||||
raise PermissionError("read-only")
|
||||
|
||||
monkeypatch.setattr("gui_v6.processing_runner.Path.mkdir", boom)
|
||||
runner = ProcessingRunner(process_fn=lambda d, o: {})
|
||||
with pytest.raises(OutputNotWritableError):
|
||||
runner.run(src, out)
|
||||
|
||||
|
||||
def test_no_double_run(tmp_path):
|
||||
_touch(tmp_path / "a.pdf")
|
||||
started = threading.Event()
|
||||
|
||||
Reference in New Issue
Block a user