Fall back from invalid preset stores (#1402)

This commit is contained in:
red person
2026-06-03 08:12:31 +03:00
committed by GitHub
parent 4aabc068ed
commit 56cd8add18
2 changed files with 15 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
import json
from src.preset_manager import PresetManager
def test_non_object_preset_store_falls_back_to_defaults(tmp_path):
(tmp_path / "presets.json").write_text(json.dumps([]))
manager = PresetManager(str(tmp_path))
assert manager.presets == PresetManager.DEFAULT_PRESETS
assert manager.get("custom")["enabled"] is False