| 1 |
#!/usr/bin/env python |
| 2 |
# -*- coding: utf-8 -*- |
| 3 |
|
| 4 |
# #################################################################### |
| 5 |
# Copyright (C) 2005-2019 by the FIFE team |
| 6 |
# http://www.fifengine.net |
| 7 |
# This file is part of FIFE. |
| 8 |
# |
| 9 |
# FIFE is free software; you can redistribute it and/or |
| 10 |
# modify it under the terms of the GNU Lesser General Public |
| 11 |
# License as published by the Free Software Foundation; either |
| 12 |
# version 2.1 of the License, or (at your option) any later version. |
| 13 |
# |
| 14 |
# This library is distributed in the hope that it will be useful, |
| 15 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 17 |
# Lesser General Public License for more details. |
| 18 |
# |
| 19 |
# You should have received a copy of the GNU Lesser General Public |
| 20 |
# License along with this library; if not, write to the |
| 21 |
# Free Software Foundation, Inc., |
| 22 |
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 23 |
# #################################################################### |
| 24 |
|
| 25 |
from .swig_test_utils import * |
| 26 |
|
| 27 |
class TestController(unittest.TestCase): |
| 28 |
|
| 29 |
def setUp(self): |
| 30 |
self.engine = getEngine(True) |
| 31 |
|
| 32 |
def tearDown(self): |
| 33 |
self.engine.destroy() |
| 34 |
|
| 35 |
def testInstances(self): |
| 36 |
print("\nTest SoundManager") |
| 37 |
self.assertTrue(self.engine.getSoundManager()) |
| 38 |
print("Test EventManager") |
| 39 |
self.assertTrue(self.engine.getEventManager()) |
| 40 |
print("Test TimeManager") |
| 41 |
self.assertTrue(self.engine.getTimeManager()) |
| 42 |
print("Test ImageManager") |
| 43 |
self.assertTrue(self.engine.getImageManager()) |
| 44 |
print("Test AnimationManager") |
| 45 |
self.assertTrue(self.engine.getAnimationManager()) |
| 46 |
print("Test SoundClipManager") |
| 47 |
self.assertTrue(self.engine.getSoundClipManager()) |
| 48 |
print("Test LogManager") |
| 49 |
self.assertTrue(self.engine.getLogManager()) |
| 50 |
pass |
| 51 |
|
| 52 |
def testPumping(self): |
| 53 |
self.engine.initializePumping() |
| 54 |
for i in range(10): |
| 55 |
self.engine.pump() |
| 56 |
self.engine.finalizePumping() |
| 57 |
|
| 58 |
TEST_CLASSES = [TestController] |
| 59 |
|
| 60 |
if __name__ == '__main__': |
| 61 |
unittest.main() |