feat(gui): log fichier rotatif V6 à chemin connu (E1)
This commit is contained in:
16
tests/unit/test_gui_v6_logging_setup.py
Normal file
16
tests/unit/test_gui_v6_logging_setup.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import logging
|
||||
|
||||
|
||||
def test_setup_file_logging_writes_to_known_path(tmp_path, monkeypatch):
|
||||
monkeypatch.setenv("LOCALAPPDATA", str(tmp_path))
|
||||
from gui_v6.logging_setup import setup_file_logging, _reset_for_tests
|
||||
|
||||
try:
|
||||
log_path = setup_file_logging()
|
||||
assert log_path.parent.exists()
|
||||
logging.getLogger("test.e1").warning("ligne-temoin-42")
|
||||
for h in logging.getLogger().handlers:
|
||||
h.flush()
|
||||
assert "ligne-temoin-42" in log_path.read_text(encoding="utf-8")
|
||||
finally:
|
||||
_reset_for_tests()
|
||||
Reference in New Issue
Block a user