panda3d/tests/gui/test_DirectButton.py
2024-01-23 14:51:44 +01:00

22 lines
594 B
Python

from direct.gui.DirectButton import DirectButton
def test_button_default_extraArgs():
btn = DirectButton()
assert btn.configure('extraArgs') == ('extraArgs', [], [])
assert btn._optionInfo['extraArgs'] == [[], [], None]
# Changing will not affect default value
btn['extraArgs'].append(1)
assert btn.configure('extraArgs') == ('extraArgs', [], [1])
# Changing this does
btn.configure('extraArgs')[1].append(2)
assert btn.configure('extraArgs') == ('extraArgs', [2], [1])
def test_button_destroy():
btn = DirectButton(text="Test")
btn.destroy()