Files
odysseus/tests/test_theme_cli_store.py

16 lines
462 B
Python
Raw Normal View History

2026-06-03 08:12:35 +03:00
import pytest
from tests.helpers.cli_loader import load_script
2026-06-03 08:12:35 +03:00
@pytest.mark.parametrize("payload", ["[]", '{"_users": []}'])
def test_load_prefs_rejects_non_object_user_store(tmp_path, capsys, payload):
cli = load_script("odysseus-theme")
2026-06-03 08:12:35 +03:00
cli._USER_PREFS_PATH = tmp_path / "user_prefs.json"
cli._USER_PREFS_PATH.write_text(payload)
with pytest.raises(SystemExit):
cli._load_prefs()
assert "is corrupt" in capsys.readouterr().err