Files
Grinch-AP/worlds/jakanddaxter/test/test_trades.py
massimilianodelliubaldini d19bf98dc4 Jak and Daxter: Post-merge Polish (#5031)
- Cleans up a few missed references in the setup guide.
- Refactors Options class to use metaclass and decorators to enforce friendly limits on multiple levels.    
  - Templates generated from the website, even ones with `random` should not fail generation because the website will only allow values inside the friendly limits. 
  - _Uploaded_ yamls to the website with `random`, should also now respect friendly limits without the need for `random-range` shenanigans.
  - _Uploaded_ yamls to the website, or yamls that are used to generate locally, that have hard-defined values outside the friendly limits, will be clamped/dragged/massaged into those limits (with logged warnings).
- Removed an early completion goal that was playing havoc with fill. Not enough people seem to use this goal, so its loss will not be mourned.
2025-05-30 16:31:00 +02:00

40 lines
1.4 KiB
Python

from .bases import JakAndDaxterTestBase
class TradesCostNothingTest(JakAndDaxterTestBase):
options = {
"enable_orbsanity": 2,
"global_orbsanity_bundle_size": 10,
"citizen_orb_trade_amount": 0,
"oracle_orb_trade_amount": 0
}
def test_orb_items_are_filler(self):
self.collect_all_but("")
self.assertNotIn("10 Precursor Orbs", self.multiworld.state.prog_items)
def test_trades_are_accessible(self):
self.assertTrue(self.multiworld
.get_location("SV: Bring 90 Orbs To The Mayor", self.player)
.can_reach(self.multiworld.state))
class TradesCostEverythingTest(JakAndDaxterTestBase):
options = {
"enable_orbsanity": 2,
"global_orbsanity_bundle_size": 10,
"citizen_orb_trade_amount": 120,
"oracle_orb_trade_amount": 150
}
def test_orb_items_are_progression(self):
self.collect_all_but("")
self.assertIn("10 Precursor Orbs", self.multiworld.state.prog_items[self.player])
self.assertEqual(198, self.multiworld.state.prog_items[self.player]["10 Precursor Orbs"])
def test_trades_are_accessible(self):
self.collect_all_but("")
self.assertTrue(self.multiworld
.get_location("SV: Bring 90 Orbs To The Mayor", self.player)
.can_reach(self.multiworld.state))