ya2 · news · projects · code · about

removed uml diagrams
[pmachines.git] / tests / lib / engine / test_cbmux.py
CommitLineData
0f9675ba
FC
1from pathlib import Path
2import sys
3if '' in sys.path: sys.path.remove('')
4sys.path.append(str(Path(__file__).parent.parent.parent))
5from unittest import TestCase
6from unittest.mock import MagicMock
7from panda3d.core import loadPrcFileData
53ddf3c3 8from ya2.engine.engine import Engine
0f9675ba
FC
9
10
11class EngineCBMuxTests(TestCase):
12
13 def setUp(self):
14 loadPrcFileData('', 'window-type none')
15 loadPrcFileData('', 'audio-library-name null')
16 self.eng = Engine()
17
18 def tearDown(self):
19 self.eng.destroy()
20
21 def _callback(self, arg): pass
22
23 def test_cbmux(self):
24 self._callback = MagicMock(side_effect=self._callback)
25 self.eng.cb_mux.add_cb(self._callback, [42])
26 taskMgr.step()
27 self._callback.assert_called_with(42)