Module DialogTest
[hide private]
[frames] | no frames]

Source Code for Module DialogTest

 1  ##################################################################### 
 2  # -*- coding: iso-8859-1 -*-                                        # 
 3  #                                                                   # 
 4  # Frets on Fire                                                     # 
 5  # Copyright (C) 2006 Sami Kyöstilä                                  # 
 6  #                                                                   # 
 7  # This program is free software; you can redistribute it and/or     # 
 8  # modify it under the terms of the GNU General Public License       # 
 9  # as published by the Free Software Foundation; either version 2    # 
10  # of the License, or (at your option) any later version.            # 
11  #                                                                   # 
12  # This program is distributed in the hope that it will be useful,   # 
13  # but WITHOUT ANY WARRANTY; without even the implied warranty of    # 
14  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the     # 
15  # GNU General Public License for more details.                      # 
16  #                                                                   # 
17  # You should have received a copy of the GNU General Public License # 
18  # along with this program; if not, write to the Free Software       # 
19  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,        # 
20  # MA  02110-1301, USA.                                              # 
21  ##################################################################### 
22   
23  import unittest 
24  from GameEngine import GameEngine 
25  from Dialogs import getText 
26  from View import Layer 
27   
28 -class TestLayer(Layer):
29 - def __init__(self, engine):
30 self.text = None 31 self.engine = engine
32
33 - def run(self, ticks):
34 if not self.text: 35 self.text = "tmp" 36 self.text = getText(self.engine, "Enter name:", "Wario")
37
38 -class DialogTestInteractive(unittest.TestCase):
39 - def testGetTest(self):
40 text = getText(self.e, "Please enter your name:", "Wario")
41
42 - def setUp(self):
43 self.e = GameEngine()
44
45 - def tearDown(self):
46 self.e.quit()
47 48 if __name__ == "__main__": 49 unittest.main() 50