mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-28 15:53:55 -04:00
tests: add unit test for track-gui-items setting in DirectGUI
This commit is contained in:
parent
062460cbe0
commit
1318fd80d7
22
tests/gui/test_DirectGuiBase.py
Normal file
22
tests/gui/test_DirectGuiBase.py
Normal file
@ -0,0 +1,22 @@
|
||||
from direct.gui.DirectGuiBase import DirectGuiWidget
|
||||
from direct.showbase.ShowBase import ShowBase
|
||||
from direct.showbase import ShowBaseGlobal
|
||||
from panda3d import core
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.mark.skipif(not ShowBaseGlobal.__dev__, reason="requires want-dev")
|
||||
def test_track_gui_items():
|
||||
page = core.load_prc_file_data("", "track-gui-items true")
|
||||
try:
|
||||
item = DirectGuiWidget()
|
||||
id = item.guiId
|
||||
|
||||
assert id in ShowBase.guiItems
|
||||
assert ShowBase.guiItems[id] == item
|
||||
|
||||
item.destroy()
|
||||
|
||||
assert id not in ShowBase.guiItems
|
||||
finally:
|
||||
core.unload_prc_file(page)
|
Loading…
x
Reference in New Issue
Block a user