"""Tests for Patron state on the world. No GPU. Run: python -m pytest tests/ -q """ import sys from pathlib import Path sys.path.insert(0, str(Path(__file__).resolve().parents[1])) from ttw.world import Patron, WorldState, seed_world def test_seed_world_patron_defaults(): p = seed_world().patron assert p.purse == 500 assert p.reputation == 50 assert p.heat == 0 def test_legacy_positional_worldstate_still_constructs(): """v1 built WorldState positionally with the first four fields; new fields are all defaulted, so that construction must still work.""" world = WorldState( 0, {}, {"acorns": 4.0}, {"acorns": 1.0}, ) assert isinstance(world.patron, Patron) assert world.pending_moves == []