Mercurial > pyntnclick
annotate gamelib/tests/test_scene_interactions_cryo.py @ 93:350ce4ebe122
Detail view without any functionality.
author | Jeremy Thurgood <firxen@gmail.com> |
---|---|
date | Tue, 24 Aug 2010 00:43:32 +0200 |
parents | 6b0f7364f3bf |
children | e97244b1be30 |
rev | line source |
---|---|
60 | 1 import game_logic_utils |
2 | |
3 | |
4 class TestGameLogic(game_logic_utils.GameLogicTestCase): | |
5 | |
6 CURRENT_SCENE = 'cryo' | |
7 | |
8 def test_cryo_door_closed_hand(self): | |
9 "The door is closed and we touch it with the hand. No change." | |
10 | |
11 self.assert_game_data('accessible', True) | |
12 self.assert_game_data('accessible', False, scene='bridge') | |
13 self.assert_game_data('open', False, 'cryo.door') | |
14 | |
15 self.interact_thing('cryo.door') | |
16 | |
17 self.assert_game_data('accessible', True) | |
18 self.assert_game_data('accessible', False, scene='bridge') | |
19 self.assert_game_data('open', False, 'cryo.door') | |
20 | |
21 def test_cryo_door_closed_titanium_leg(self): | |
22 "The door is closed and we touch it with the titanium leg. It opens." | |
23 | |
67
6b0f7364f3bf
Inventory-related game state.
Jeremy Thurgood <firxen@gmail.com>
parents:
60
diff
changeset
|
24 self.state.add_inventory_item('titanium_leg') |
60 | 25 self.assert_game_data('accessible', True) |
26 self.assert_game_data('accessible', False, scene='bridge') | |
27 self.assert_game_data('open', False, 'cryo.door') | |
28 | |
29 self.interact_thing('cryo.door', 'titanium_leg') | |
30 | |
31 self.assert_game_data('accessible', True) | |
32 self.assert_game_data('accessible', True, scene='bridge') | |
33 self.assert_game_data('open', True, 'cryo.door') | |
67
6b0f7364f3bf
Inventory-related game state.
Jeremy Thurgood <firxen@gmail.com>
parents:
60
diff
changeset
|
34 self.assert_inventory_item('titanium_leg', False) |
60 | 35 |
36 def test_cryo_door_open_hand(self): | |
37 "The door is open and we touch it with the hand. No change." | |
38 | |
39 self.set_game_data('accessible', True, scene='bridge') | |
40 self.set_game_data('open', True, 'cryo.door') | |
41 | |
42 self.interact_thing('cryo.door') | |
43 | |
44 self.assert_game_data('accessible', True) | |
45 self.assert_game_data('accessible', True, scene='bridge') | |
46 self.assert_game_data('open', True, 'cryo.door') | |
47 | |
48 def test_cryo_door_open_titanium_leg(self): | |
49 "The door is open and we touch it with the titanium leg. No change." | |
50 | |
51 self.set_game_data('accessible', True, scene='bridge') | |
52 self.set_game_data('open', True, 'cryo.door') | |
53 | |
54 self.interact_thing('cryo.door', 'titanium_leg') | |
55 | |
56 self.assert_game_data('accessible', True) | |
57 self.assert_game_data('accessible', True, scene='bridge') | |
58 self.assert_game_data('open', True, 'cryo.door') | |
67
6b0f7364f3bf
Inventory-related game state.
Jeremy Thurgood <firxen@gmail.com>
parents:
60
diff
changeset
|
59 |
6b0f7364f3bf
Inventory-related game state.
Jeremy Thurgood <firxen@gmail.com>
parents:
60
diff
changeset
|
60 def test_cryo_unit_alpha_full_hand(self): |
6b0f7364f3bf
Inventory-related game state.
Jeremy Thurgood <firxen@gmail.com>
parents:
60
diff
changeset
|
61 "The cryo unit has the leg in it and we touch it. We get the leg." |
6b0f7364f3bf
Inventory-related game state.
Jeremy Thurgood <firxen@gmail.com>
parents:
60
diff
changeset
|
62 |
6b0f7364f3bf
Inventory-related game state.
Jeremy Thurgood <firxen@gmail.com>
parents:
60
diff
changeset
|
63 self.assert_game_data('contains_titanium_leg', True, 'cryo.unit.1') |
6b0f7364f3bf
Inventory-related game state.
Jeremy Thurgood <firxen@gmail.com>
parents:
60
diff
changeset
|
64 self.assert_inventory_item('titanium_leg', False) |
6b0f7364f3bf
Inventory-related game state.
Jeremy Thurgood <firxen@gmail.com>
parents:
60
diff
changeset
|
65 |
6b0f7364f3bf
Inventory-related game state.
Jeremy Thurgood <firxen@gmail.com>
parents:
60
diff
changeset
|
66 self.interact_thing('cryo.unit.1') |
6b0f7364f3bf
Inventory-related game state.
Jeremy Thurgood <firxen@gmail.com>
parents:
60
diff
changeset
|
67 |
6b0f7364f3bf
Inventory-related game state.
Jeremy Thurgood <firxen@gmail.com>
parents:
60
diff
changeset
|
68 self.assert_game_data('contains_titanium_leg', False, 'cryo.unit.1') |
6b0f7364f3bf
Inventory-related game state.
Jeremy Thurgood <firxen@gmail.com>
parents:
60
diff
changeset
|
69 self.assert_inventory_item('titanium_leg', True) |