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
8 from ya2
.engine
.engine
import Engine
9 from ya2
.engine
.audio
import EngineAudio
12 class EngineClockTests(TestCase
):
15 loadPrcFileData('', 'window-type none')
16 loadPrcFileData('', 'audio-library-name null')
23 # this test shows that even if you process frames, the engine's clock
24 # is storing the unpaused time
25 start_time
= self
.eng
.clock
.time
26 self
.eng
.pause
.logic
.pause()
28 self
.eng
.pause
.logic
.resume()
29 self
.assertEqual(start_time
, self
.eng
.clock
.time
)