24 lines
787 B
Python
24 lines
787 B
Python
"""Tests for edkb per-file timeout selection."""
|
|
from __future__ import annotations
|
|
|
|
from pathlib import Path
|
|
|
|
from edkb_system.controller import _file_timeout_sec
|
|
|
|
|
|
def test_excel_skips_spawn_timeout_wrapper(monkeypatch):
|
|
monkeypatch.setenv('EDKB_FILE_TIMEOUT_SEC', '180')
|
|
assert _file_timeout_sec(Path('report.xlsx')) is None
|
|
assert _file_timeout_sec(Path('data.csv')) is None
|
|
|
|
|
|
def test_word_still_uses_word_timeout(monkeypatch):
|
|
monkeypatch.setenv('EDKB_FILE_TIMEOUT_SEC', '180')
|
|
monkeypatch.setenv('EDKB_WORD_FILE_TIMEOUT_SEC', '420')
|
|
assert _file_timeout_sec(Path('manual.docx')) == 420
|
|
|
|
|
|
def test_other_formats_use_global_timeout(monkeypatch):
|
|
monkeypatch.setenv('EDKB_FILE_TIMEOUT_SEC', '180')
|
|
assert _file_timeout_sec(Path('slides.pptx')) == 180
|