comparison gamelib/tests/test_scene_interactions_cryo.py @ 252:dfc89bc64fdb

Start of walkthrough "unit test" and associated fixes and tweaks.
author Jeremy Thurgood <firxen@gmail.com>
date Fri, 27 Aug 2010 16:45:47 +0200
parents 0bad554d0926
children ca0c2875ad8f
comparison
equal deleted inserted replaced
251:602fe654bd37 252:dfc89bc64fdb
50 50
51 self.set_game_data('door', 'open', 'cryo.door') 51 self.set_game_data('door', 'open', 'cryo.door')
52 52
53 self.interact_thing('cryo.door') 53 self.interact_thing('cryo.door')
54 54
55 self.assert_game_data('door', 'open', 'cryo.door') 55 self.assert_game_data('door', 'open', 'cryo.door', scene='cryo')
56 self.assertEquals('map', self.state.current_scene.name) 56 self.assert_current_scene('map')
57 57
58 def test_cryo_door_open_titanium_leg(self): 58 def test_cryo_door_open_titanium_leg(self):
59 "The door is open and we touch it with the titanium leg. No change." 59 "The door is open and we touch it with the titanium leg. No change."
60 60
61 self.set_game_data('door', 'open', 'cryo.door') 61 self.set_game_data('door', 'open', 'cryo.door')
62 62
63 self.interact_thing('cryo.door', 'titanium_leg') 63 self.interact_thing('cryo.door', 'titanium_leg')
64 64
65 self.assert_game_data('door', 'open', 'cryo.door') 65 self.assert_game_data('door', 'open', 'cryo.door')
66 self.assertEquals('cryo', self.state.current_scene.name) 66 self.assert_current_scene('cryo')
67 67
68 def test_cryo_unit_alpha_full_hand(self): 68 def test_cryo_unit_alpha_full_hand(self):
69 "The cryo unit has the leg in it and we touch it. We get the leg." 69 "The cryo unit has the leg in it and we touch it. We get the leg."
70 70
71 self.state.set_current_detail('cryo_detail') 71 self.state.set_current_detail('cryo_detail')
72 self.assert_game_data('contains_titanium_leg', True, 'cryo.unit.1') 72 self.assert_game_data('contains_titanium_leg', True, 'cryo.unit.1')
73 self.assert_inventory_item('titanium_leg', False) 73 self.assert_inventory_item('titanium_leg', False)
74 self.assert_detail_thing('cryo.titanium_leg', True) 74 self.assert_detail_thing('cryo.titanium_leg', True)
75 75
76 self.interact_thing('cryo.titanium_leg', detail='cryo_detail') 76 self.interact_thing('cryo.titanium_leg')
77 77
78 self.assert_game_data('contains_titanium_leg', False, 'cryo.unit.1') 78 self.assert_game_data('contains_titanium_leg', False, 'cryo.unit.1')
79 self.assert_inventory_item('titanium_leg', True) 79 self.assert_inventory_item('titanium_leg', True)
80 self.assert_detail_thing('cryo.titanium_leg', False) 80 self.assert_detail_thing('cryo.titanium_leg', False)
81 81