Fix exploration member selection and automatic reward collection

This commit is contained in:
AttilaNet
2026-11-09 15:10:16 +08:00
parent eaaad3488b
commit 5d2da97b90
5 changed files with 91 additions and 11 deletions
+11
View File
@@ -136,6 +136,17 @@ class ExplorationTests(unittest.TestCase):
self.assertEqual(self.action().kind, "explore_finish")
self.assertEqual(self.planner.rows(self.snapshot, policy(), self.ranch)[0]["monster_ids"], [1, 2, 3])
def test_finished_team_rewards_without_reenabling_restart(self):
team = self.snapshot.raw["exploreTeams"][0]
self.start_confirmed(team, end=NOW - 1)
disabled = ExplorePolicy(True, {"1": ExploreTeamRule(enabled=False, area="1")})
actions = self.planner.plan(self.snapshot, disabled, self.ranch)
self.assertEqual([(action.kind, action.path) for action in actions],
[("explore_finish", "exploreService/finish")])
row = self.planner.rows(self.snapshot, disabled, self.ranch)[0]
self.assertEqual(row["state"], "可领取")
self.assertIn("仍会自动领取奖励", row["reason"])
def test_active_zero_or_missing_deadline_is_unknown_and_never_finished(self):
for value in (None, 0, "", "not-a-time"):
with self.subTest(value=value):