Mercurial > boomslang
diff gamelib/tests/test_scene_interactions_cryo.py @ 852:f95830b58336
Merge pyntnclick
author | Stefano Rivera <stefano@rivera.za.net> |
---|---|
date | Sat, 21 Jun 2014 22:04:35 +0200 |
parents | eed75a1d50c4 |
children |
line wrap: on
line diff
--- a/gamelib/tests/test_scene_interactions_cryo.py Sat Jun 21 17:38:39 2014 +0000 +++ b/gamelib/tests/test_scene_interactions_cryo.py Sat Jun 21 22:04:35 2014 +0200 @@ -1,8 +1,11 @@ -import game_logic_utils +from pyntnclick.tests.game_logic_utils import GameLogicTestCase + +import gamelib.main -class TestGameLogic(game_logic_utils.GameLogicTestCase): +class TestGameLogic(GameLogicTestCase): + GAME_DESCRIPTION_CLASS = gamelib.main.SuspendedSentence CURRENT_SCENE = 'cryo' def test_cryo_door_closed_hand(self): @@ -20,10 +23,10 @@ self.state.add_inventory_item('titanium_leg') self.assert_game_data('door', 'shut', 'cryo.door') - self.interact_thing('cryo.door', 'titanium_leg') + self.interact_thing('cryo.door', 'titanium_leg:') self.assert_game_data('door', 'shut', 'cryo.door') - self.assert_inventory_item('titanium_leg', True) + 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." @@ -40,10 +43,10 @@ self.state.add_inventory_item('titanium_leg') self.set_game_data('door', 'ajar', 'cryo.door') - self.interact_thing('cryo.door', 'titanium_leg') + self.interact_thing('cryo.door', 'titanium_leg:') self.assert_game_data('door', 'open', 'cryo.door') - self.assert_inventory_item('titanium_leg', True) + self.assert_inventory_item('titanium_leg:', True) def test_cryo_door_open_hand(self): "The door is open and we touch it with the hand. We go to the map." @@ -61,7 +64,7 @@ self.state.add_inventory_item('titanium_leg') self.set_game_data('door', 'open', 'cryo.door') - self.interact_thing('cryo.door', 'titanium_leg') + self.interact_thing('cryo.door', 'titanium_leg:') self.assert_game_data('door', 'open', 'cryo.door') self.assert_current_scene('cryo') @@ -69,16 +72,15 @@ def test_cryo_unit_alpha_full_hand(self): "The cryo unit has the leg in it and we touch it. We get the leg." + self.interact_thing('cryo.unit.1') self.assert_game_data('contains_titanium_leg', True, 'cryo.unit.1') - self.state.set_current_detail('cryo_detail') - self.assert_inventory_item('titanium_leg', False) + self.assert_inventory_item('titanium_leg:', False) self.assert_detail_thing('cryo.titanium_leg', True) - self.interact_thing('cryo.titanium_leg') + self.interact_thing('cryo.titanium_leg', detail='cryo_detail') - self.assert_inventory_item('titanium_leg', True) + self.assert_inventory_item('titanium_leg:', True) self.assert_detail_thing('cryo.titanium_leg', False) - self.close_detail() self.assert_game_data('contains_titanium_leg', False, 'cryo.unit.1') def test_cryo_unit_detail(self): @@ -126,26 +128,26 @@ self.assert_game_data('fixed', True, 'cryo.pipe.left') self.assert_game_data('fixed', True, 'cryo.pipe.right.top') self.assert_game_data('fixed', True, 'cryo.pipe.right.bottom') - self.assert_item_exists('cryo_pipe.0', False) - self.assert_item_exists('cryo_pipe.1', False) - self.assert_item_exists('cryo_pipe.2', False) + self.assert_item_exists('cryo_pipe:0', False) + self.assert_item_exists('cryo_pipe:1', False) + self.assert_item_exists('cryo_pipe:2', False) self.assertNotEquals( - None, self.interact_thing('cryo.pipe.left', 'machete')) + None, self.interact_thing('cryo.pipe.left', 'machete:')) self.assertNotEquals( - None, self.interact_thing('cryo.pipe.right.top', 'machete')) + None, self.interact_thing('cryo.pipe.right.top', 'machete:')) self.assertNotEquals( - None, self.interact_thing('cryo.pipe.right.bottom', 'machete')) + None, self.interact_thing('cryo.pipe.right.bottom', 'machete:')) self.assert_game_data('fixed', False, 'cryo.pipe.left') self.assert_game_data('fixed', False, 'cryo.pipe.right.top') self.assert_game_data('fixed', False, 'cryo.pipe.right.bottom') - self.assert_item_exists('tube_fragment.0') - self.assert_item_exists('tube_fragment.1') - self.assert_item_exists('tube_fragment.2') - self.assert_inventory_item('tube_fragment.0', True) - self.assert_inventory_item('tube_fragment.1', True) - self.assert_inventory_item('tube_fragment.2', True) + self.assert_item_exists('tube_fragment:0') + self.assert_item_exists('tube_fragment:1') + self.assert_item_exists('tube_fragment:2') + self.assert_inventory_item('tube_fragment:0', True) + self.assert_inventory_item('tube_fragment:1', True) + self.assert_inventory_item('tube_fragment:2', True) def test_pipes_chopped_machete(self): "Touch the chopped cryopipes with the machete. No change." @@ -156,11 +158,11 @@ self.set_game_data('fixed', False, 'cryo.pipe.right.bottom') self.assertEquals( - None, self.interact_thing('cryo.pipe.left', 'machete')) + None, self.interact_thing('cryo.pipe.left', 'machete:')) self.assertEquals( - None, self.interact_thing('cryo.pipe.right.top', 'machete')) + None, self.interact_thing('cryo.pipe.right.top', 'machete:')) self.assertEquals( - None, self.interact_thing('cryo.pipe.right.bottom', 'machete')) + None, self.interact_thing('cryo.pipe.right.bottom', 'machete:')) self.assert_game_data('fixed', False, 'cryo.pipe.left') self.assert_game_data('fixed', False, 'cryo.pipe.right.top')