Updated silver and item collection

This commit is contained in:
2026-10-10 12:10:06 -06:00
parent 59a9fa4098
commit 85a844208a
17 changed files with 615 additions and 33 deletions
+31
View File
@@ -0,0 +1,31 @@
import json
from src import environment
from src.decode import discovery
def test_qt_args_removes_app_specific_options():
assert environment.qt_args([
'aostats', '--verbose', '--log-path', '/tmp/capture.jsonl',
'--style', 'fusion']) == ['aostats', '--style', 'fusion']
assert environment.qt_args([
'aostats', '--log-path=/tmp/capture.jsonl']) == ['aostats']
def test_discovery_log_writes_jsonl_with_item_annotations(monkeypatch, tmp_path):
path = tmp_path / 'capture.jsonl'
monkeypatch.setattr(discovery, 'discovery_log_path', lambda: str(path))
monkeypatch.setattr(discovery, '_initialized', False)
monkeypatch.setattr(discovery.itemdb, 'get_db', lambda: {836: 'T6_STONEBLOCK'})
discovery.log('game_message', params={1: [836], 2: b'\x01'})
rows = [json.loads(line) for line in path.read_text().splitlines()]
assert rows[0]['type'] == 'session_start'
assert rows[1]['type'] == 'game_message'
assert discovery.item_candidates({1: [836]}) == [{
'path': '1[0]',
'id': 836,
'unique_name': 'T6_STONEBLOCK',
}]