Fix missing sapling report in tree planting

This commit is contained in:
Tanner
2026-11-06 00:04:37 +00:00
parent c323ea8373
commit a60d913c60
2 changed files with 22 additions and 1 deletions
+21
View File
@@ -0,0 +1,21 @@
import unittest
from munch import Munch
from mosfet.jobs.plant_tree import PlantTreeStates
class PlantTreeTests(unittest.TestCase):
def test_missing_inventory_sapling_aborts_without_crashing(self):
class FakeGame:
@staticmethod
def select_item(_item_ids):
return False
state = PlantTreeStates(Munch(
pos=(0, 64, 0), chopped_tree='oak', game=FakeGame()))
state.select_sapling()
self.assertIs(state.state.__func__, state.cleanup.__func__)
if __name__ == '__main__':
unittest.main()