22 lines
578 B
Python
22 lines
578 B
Python
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()
|