Cache after sleep near labeled chests
This commit is contained in:
@@ -52,6 +52,27 @@ class FakeGame:
|
||||
|
||||
|
||||
class TestSleepWithBed(unittest.TestCase):
|
||||
def test_confirmed_sleep_records_bed_for_following_cache_pass(self):
|
||||
bed = (1, 64, 2)
|
||||
g = Munch(world=FakeWorld(), path=[], look_at=None)
|
||||
state = SleepWithBedStates(g)
|
||||
state.area = bed
|
||||
state.sleep_confirmed = True
|
||||
|
||||
state.cleanup()
|
||||
|
||||
self.assertEqual(g.post_sleep_cache_bed, bed)
|
||||
|
||||
def test_unconfirmed_sleep_does_not_trigger_post_sleep_cache(self):
|
||||
g = Munch(world=FakeWorld(), path=[], look_at=None)
|
||||
state = SleepWithBedStates(g)
|
||||
state.area = (1, 64, 2)
|
||||
state.sleep_confirmed = False
|
||||
|
||||
state.cleanup()
|
||||
|
||||
self.assertNotIn('post_sleep_cache_bed', g)
|
||||
|
||||
def test_bed_occupancy_only_logs_first_observation_and_changes(self):
|
||||
bed_states = [
|
||||
state for state in blocks.BED_IDS
|
||||
|
||||
Reference in New Issue
Block a user