ya2 · news · projects · code · about

removed uml diagrams
[pmachines.git] / tests / lib / engine / test_configuration.py
1 from pathlib import Path
2 import sys
3 if '' in sys.path: sys.path.remove('')
4 sys.path.append(str(Path(__file__).parent.parent.parent))
5 from unittest import TestCase
6 from unittest.mock import MagicMock
7 from panda3d.core import loadPrcFileData, ConfigVariableInt, ConfigVariableString
8 from ya2.engine.engine import Engine
9 from ya2.engine.configuration import Cfg
10
11
12 class EngineConfigurationTests(TestCase):
13
14 def setUp(self):
15 loadPrcFileData('', 'window-type none')
16 loadPrcFileData('', 'audio-library-name null')
17 self.eng = Engine()
18
19 def tearDown(self):
20 self.eng.destroy()
21
22 def test_cfg(self):
23 # let's check some fields
24 self.assertEqual(self.eng.cfg.gui_cfg.fps, False)
25 self.assertEqual(self.eng.cfg.profiling_cfg.profiling, False)
26 self.assertEqual(self.eng.cfg.lang_cfg.lang, 'en')
27 self.assertEqual(self.eng.cfg.cursor_cfg.cursor_hidden, False)
28 self.assertEqual(self.eng.cfg.dev_cfg.multithreaded_render, False)
29
30 def test_cfg_configure(self):
31 # let's check that __configure has been executed
32 self.assertEqual(ConfigVariableInt('texture-anosotropic-degree').getValue(), 2)