1 from pathlib
import Path
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 lib
.engine
.engine
import Engine
9 from lib
.engine
.configuration
import Cfg
12 class EngineConfigurationTests(TestCase
):
15 loadPrcFileData('', 'window-type none')
16 loadPrcFileData('', 'audio-library-name null')
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)
30 def test_cfg_configure(self
):
31 # let's check that __configure has been executed
32 self
.assertEqual(ConfigVariableInt('texture-anosotropic-degree').getValue(), 2)