# HG changeset patch # User Jeremy Thurgood # Date 1282630270 -7200 # Node ID e97244b1be30ed1d60162d6b823cb95aba2d6434 # Parent 60770ca02c1af4be7cd5551b81740832e205aaa1 Fix tests for new tristate door logic. diff -r 60770ca02c1a -r e97244b1be30 gamelib/tests/test_scene_interactions_cryo.py --- a/gamelib/tests/test_scene_interactions_cryo.py Tue Aug 24 07:51:42 2010 +0200 +++ b/gamelib/tests/test_scene_interactions_cryo.py Tue Aug 24 08:11:10 2010 +0200 @@ -6,17 +6,17 @@ CURRENT_SCENE = 'cryo' def test_cryo_door_closed_hand(self): - "The door is closed and we touch it with the hand. No change." + "The door is closed and we touch it with the hand. It becomes ajar." self.assert_game_data('accessible', True) self.assert_game_data('accessible', False, scene='bridge') - self.assert_game_data('open', False, 'cryo.door') + self.assert_game_data('door', 'shut', 'cryo.door') self.interact_thing('cryo.door') self.assert_game_data('accessible', True) self.assert_game_data('accessible', False, scene='bridge') - self.assert_game_data('open', False, 'cryo.door') + self.assert_game_data('door', 'ajar', 'cryo.door') def test_cryo_door_closed_titanium_leg(self): "The door is closed and we touch it with the titanium leg. It opens." @@ -24,13 +24,41 @@ self.state.add_inventory_item('titanium_leg') self.assert_game_data('accessible', True) self.assert_game_data('accessible', False, scene='bridge') - self.assert_game_data('open', False, 'cryo.door') + self.assert_game_data('door', 'shut', 'cryo.door') + + self.interact_thing('cryo.door', 'titanium_leg') + + self.assert_game_data('accessible', True) + self.assert_game_data('accessible', False, scene='bridge') + self.assert_game_data('door', 'shut', 'cryo.door') + self.assert_inventory_item('titanium_leg', True) + + def test_cryo_door_ajar_hand(self): + "The door is ajar and we touch it with the hand. No change." + + self.set_game_data('door', 'ajar', 'cryo.door') + self.assert_game_data('accessible', True) + self.assert_game_data('accessible', False, scene='bridge') + + self.interact_thing('cryo.door') + + self.assert_game_data('accessible', True) + self.assert_game_data('accessible', False, scene='bridge') + self.assert_game_data('door', 'ajar', 'cryo.door') + + def test_cryo_door_ajar_titanium_leg(self): + "The door is ajar and we touch it with the titanium leg. It opens." + + self.state.add_inventory_item('titanium_leg') + self.set_game_data('door', 'ajar', 'cryo.door') + self.assert_game_data('accessible', True) + self.assert_game_data('accessible', False, scene='bridge') self.interact_thing('cryo.door', 'titanium_leg') self.assert_game_data('accessible', True) self.assert_game_data('accessible', True, scene='bridge') - self.assert_game_data('open', True, 'cryo.door') + self.assert_game_data('door', 'open', 'cryo.door') self.assert_inventory_item('titanium_leg', False) def test_cryo_door_open_hand(self):