be0d69d03b27a13f90e003ae2c9df94b6d654a1e
1 from panda3d
.core
import load_prc_file_data
2 load_prc_file_data('', 'window-type offscreen')
3 from pathlib
import Path
5 if '' in sys
.path
: sys
.path
.remove('')
6 sys
.path
.append(str(Path(__file__
).parent
.parent
.parent
))
7 from unittest
import TestCase
8 from unittest
.mock
import patch
9 from panda3d
.core
import get_model_path
10 from direct
.showbase
.ShowBase
import ShowBase
11 from ya2
.utils
.gui
import GuiTools
15 class TestApp(ShowBase
): pass
18 class GraphicsToolsTests(TestCase
):
21 self
.__app
= TestApp()
22 get_model_path().append_directory(str(Path(__file__
).parent
.parent
.parent
))
27 @patch.object(ya2
.utils
.gui
, 'load_prc_file_data')
28 def test_no_window(self
, l_mock
):
30 l_mock
.assert_called_once()
31 l_args
= l_mock
.call_args_list
[0].args
32 self
.assertEqual(l_args
[0], '')
33 self
.assertEqual(l_args
[1], 'window-type none')
34 self
.assertEqual(len(l_args
), 2)