fix: keep automatic cultivation on one stable primary per species
This commit is contained in:
@@ -9,6 +9,7 @@ class GiftTargetSelectionTests(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.catalog = Catalog()
|
||||
self.snapshot = gift_snapshot(self.catalog)
|
||||
self.snapshot.raw["monsters"][0]["level"] += 1
|
||||
self.planner = GiftPlanner(self.catalog)
|
||||
self.representative = next(iter(self.planner.cultivation.select(self.snapshot).values()))
|
||||
self.manual_target = next(mon for mon in self.snapshot.raw["monsters"]
|
||||
@@ -27,13 +28,20 @@ class GiftTargetSelectionTests(unittest.TestCase):
|
||||
self.assertEqual([action.payload["monsterId"] for action in self.planner.plan(self.snapshot, policy)],
|
||||
[self.representative["id"]])
|
||||
|
||||
def test_manual_mode_uses_gift_targets_instead_of_representative(self):
|
||||
def test_manual_mode_requires_the_primary_to_be_explicitly_checked(self):
|
||||
policy = self.policy()
|
||||
|
||||
self.assertEqual(self.planner.candidates(self.snapshot, policy), [])
|
||||
self.assertEqual(self.planner.plan(self.snapshot, policy), [])
|
||||
|
||||
policy.gift_targets[str(self.representative["id"])] = 2
|
||||
self.assertEqual([mon["id"] for mon in self.planner.candidates(self.snapshot, policy)],
|
||||
[self.manual_target["id"]])
|
||||
[self.representative["id"]])
|
||||
self.assertEqual([action.payload["monsterId"] for action in self.planner.plan(self.snapshot, policy)],
|
||||
[self.manual_target["id"]])
|
||||
[self.representative["id"]])
|
||||
|
||||
self.representative["feel"] = self.catalog.max_feel(self.representative)
|
||||
self.assertEqual(self.planner.plan(self.snapshot, policy), [])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user