Improve task filters, exploration rewards and V4 battle simulation
This commit is contained in:
@@ -133,6 +133,62 @@ class AutomationSchedulingTests(unittest.TestCase):
|
||||
|
||||
self.assertEqual([call[1] for call in engine.calls], ["explore", "breakthrough"])
|
||||
|
||||
def test_finished_team_dispatches_claim_without_restart_opt_in(self):
|
||||
engine = self.install_engine("explore_finish")
|
||||
self.window.explore_enabled.setChecked(False)
|
||||
self.window.arm_extended_automation()
|
||||
self.assertLess(self.window.next_explore, float("inf"))
|
||||
self.window.next_explore = time.monotonic() - 1
|
||||
|
||||
self.window.run_extended_automation()
|
||||
self.wait(lambda: bool(engine.calls))
|
||||
|
||||
self.assertEqual(engine.calls, [("poll_automation", "explore")])
|
||||
|
||||
def test_idle_team_does_not_arm_when_restart_is_disabled(self):
|
||||
self.install_engine()
|
||||
self.window.explore_enabled.setChecked(False)
|
||||
self.window.next_explore = float("inf")
|
||||
self.window.arm_extended_automation()
|
||||
self.assertEqual(self.window.next_explore, float("inf"))
|
||||
|
||||
def test_global_stop_blocks_claim_dispatch_and_disarms_timer(self):
|
||||
engine = self.install_engine("explore_finish")
|
||||
self.window.explore_enabled.setChecked(False)
|
||||
self.window.arm_extended_automation()
|
||||
self.assertLess(self.window.next_explore, float("inf"))
|
||||
self.window.stop_workflow()
|
||||
self.assertEqual(self.window.next_explore, float("inf"))
|
||||
self.window.run_extended_automation()
|
||||
self.wait()
|
||||
self.assertEqual(engine.calls, [])
|
||||
|
||||
def test_pending_reconciliation_defers_claim_timer_and_active_countdown(self):
|
||||
for pending in ("exploration", "battle"):
|
||||
with self.subTest(pending=pending):
|
||||
self.setUp()
|
||||
engine = self.install_engine("explore_finish")
|
||||
self.window.explore_enabled.setChecked(False)
|
||||
if pending == "exploration":
|
||||
engine.explore_planner.pending = Mock(return_value={"uncertain": True})
|
||||
else:
|
||||
engine._progression_pending = Mock(return_value=True)
|
||||
self.assertEqual(self.window.latest_render[1][-1].kind, "explore_finish")
|
||||
self.window.next_explore = float("inf")
|
||||
self.window.arm_extended_automation()
|
||||
self.assertEqual(self.window.next_explore, float("inf"))
|
||||
self.window.arm_extended_automation()
|
||||
self.assertEqual(self.window.next_explore, float("inf"))
|
||||
|
||||
engine.pending_recovery_due = Mock(return_value=True)
|
||||
engine.demo = False
|
||||
self.window.monitoring = True
|
||||
self.window.set_strategy_checked(True)
|
||||
self.window.next_breakthrough = float("inf")
|
||||
self.window.schedule()
|
||||
self.wait(lambda: bool(engine.calls))
|
||||
self.assertEqual(engine.calls, [("poll", {"hatch_only": False, "defer_hatch": True})])
|
||||
|
||||
def test_fast_hatch_and_gift_dispatch_only_their_own_kind(self):
|
||||
for kind in ("hatch", "gift"):
|
||||
with self.subTest(kind=kind):
|
||||
|
||||
Reference in New Issue
Block a user