Council sells useless stockpile items into the treasury

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-10-18 22:41:11 +01:00
parent b82f979b4c
commit 656693cc84
2 changed files with 31 additions and 1 deletions

View file

@ -265,6 +265,17 @@ class CityTest(unittest.TestCase):
self.assertEqual(world["city"]["queue"], [])
self.assertEqual(world["city"]["buildings"]["walls"]["fund"], {})
def test_v3_worlds_sell_useless_stock_into_the_treasury(self):
world = world_with()
world["version"] = 3
world["city"]["stockpile"] = {"copper_ore": 8, "raw_meat": 1, "bricks": 500, "bread": 30}
world["city"]["treasury"] = 10
game.migrate(world)
self.assertEqual(world["city"]["stockpile"], {"bricks": 500, "bread": 30})
self.assertEqual(world["city"]["treasury"], 10 + 8 * 2 + 1 * 2)
self.assertEqual(world["ledger"][-1]["text"],
"The council sold 8 copper ore and 1 raw meat from the stockpile for 18 gold")
def test_population_view_explains_growth(self):
world = world_with()
view = game.population_view(world)