Mercurial > boomslang
comparison pyntnclick/tests/game_logic_utils.py @ 734:c1d548a76a8c pyntnclick
disable CONVERT_ALPHA in setUp, not at import
author | Stefano Rivera <stefano@rivera.za.net> |
---|---|
date | Tue, 15 Jan 2013 23:55:24 +0200 |
parents | 2f74064bc779 |
children | 432cd9d51d80 |
comparison
equal
deleted
inserted
replaced
733:d016ac9de1bd | 734:c1d548a76a8c |
---|---|
1 import unittest | 1 import unittest |
2 | 2 |
3 import pygame.display | 3 import pygame.display |
4 | 4 |
5 import pyntnclick.resources | |
5 import pyntnclick.state | 6 import pyntnclick.state |
6 | |
7 # Disable alpha conversion which requires a screen | |
8 import pyntnclick.resources | |
9 pyntnclick.resources.Resources.CONVERT_ALPHA = False | |
10 | 7 |
11 | 8 |
12 class GameLogicTestCase(unittest.TestCase): | 9 class GameLogicTestCase(unittest.TestCase): |
13 CURRENT_SCENE = None | 10 CURRENT_SCENE = None |
14 GAME_DESCRIPTION_CLASS = None | 11 GAME_DESCRIPTION_CLASS = None |
15 | 12 |
16 def setUp(self): | 13 def setUp(self): |
17 # Events require us to initialize the display | 14 # Events require us to initialize the display |
18 pygame.display.init() | 15 pygame.display.init() |
16 # Disable alpha conversion which requires a screen | |
17 pyntnclick.resources.Resources.CONVERT_ALPHA = False | |
19 | 18 |
20 self.game_description = self.GAME_DESCRIPTION_CLASS() | 19 self.game_description = self.GAME_DESCRIPTION_CLASS() |
21 self.state = self.game_description.initial_state() | 20 self.state = self.game_description.initial_state() |
22 self.state.current_scene = self.state.scenes[self.CURRENT_SCENE] | 21 self.state.current_scene = self.state.scenes[self.CURRENT_SCENE] |
23 | 22 |