changeset 98:e97244b1be30

Fix tests for new tristate door logic.
author Jeremy Thurgood <firxen@gmail.com>
date Tue, 24 Aug 2010 08:11:10 +0200
parents 60770ca02c1a
children 367b1c9c3c6d
files gamelib/tests/test_scene_interactions_cryo.py
diffstat 1 files changed, 33 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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):