Changeset 290 for trunk/game/tests


Ignore:
Timestamp:
09/27/09 18:58:36 (10 years ago)
Author:
orlandov
Message:

Add a new test to fix broken unit test introduced by or1andov--

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/game/tests/test_dialogue.py

    r287 r290  
    2424        self.tree = { 
    2525            'START': 'main', 
     26            'AVATAR': 'npc.png', 
    2627            'SECTIONS': { 
    2728                'main': [ 
     
    5960        self.replies = ["resp1", "back", "stop"] 
    6061 
     62        def npc_avatar_cb(state, image): 
     63            state['npc_avatar'] = image 
     64 
    6165        def responses_cb(state, responses): 
    6266            state['responses'] = responses 
     
    6468        callbacks = { 
    6569            "say": say_cb, 
    66             "responses": responses_cb 
     70            "responses": responses_cb, 
     71            "npc_avatar": npc_avatar_cb 
    6772        } 
    6873 
     
    7580        self.assertEqual(responses, self.dialogue.state['responses']) 
    7681 
     82    def assert_npc_image(self, image): 
     83        self.assertEqual(image, self.dialogue.state['npc_avatar']) 
     84 
    7785    def test_simple(self): 
    7886        """Test basic dialogue interaction""" 
     
    8088        self.dialogue.run() 
    8189 
     90        self.assert_npc_image('npc.png') 
    8291        self.assert_say('Greetings stranger') 
    8392        self.assert_responses([ 
Note: See TracChangeset for help on using the changeset viewer.