Working on party stuff, mostly works

This commit is contained in:
2026-10-10 14:07:14 -06:00
parent 85a844208a
commit 60137a2de4
10 changed files with 400 additions and 21 deletions
+27
View File
@@ -0,0 +1,27 @@
import os
from src.decode import party_memory
from src.utils import platform_utils
def test_party_memory_save_load_and_clear(monkeypatch, tmp_path):
monkeypatch.setattr(platform_utils, 'config_dir', lambda: str(tmp_path))
party_memory.save_last_party([
'bionicKatana', 'fatbrick', 'fatbrick', '', None])
assert party_memory.load_last_party() == ['bionicKatana', 'fatbrick']
assert os.path.isfile(tmp_path / 'last-party.json')
party_memory.clear_last_party()
assert party_memory.load_last_party() == []
assert not os.path.exists(tmp_path / 'last-party.json')
def test_party_memory_ignores_corrupt_file(monkeypatch, tmp_path):
monkeypatch.setattr(platform_utils, 'config_dir', lambda: str(tmp_path))
path = tmp_path / 'last-party.json'
path.write_text('{not json')
assert party_memory.load_last_party() == []