feat: initial otko import
Some checks failed
CI / lint (push) Has been cancelled
CI / test (macos-latest, 3.10) (push) Has been cancelled
CI / test (macos-latest, 3.11) (push) Has been cancelled
CI / test (macos-latest, 3.12) (push) Has been cancelled
CI / test (ubuntu-latest, 3.10) (push) Has been cancelled
CI / test (ubuntu-latest, 3.11) (push) Has been cancelled
CI / test (ubuntu-latest, 3.12) (push) Has been cancelled
CI / test (windows-latest, 3.10) (push) Has been cancelled
CI / test (windows-latest, 3.11) (push) Has been cancelled
CI / test (windows-latest, 3.12) (push) Has been cancelled
Some checks failed
CI / lint (push) Has been cancelled
CI / test (macos-latest, 3.10) (push) Has been cancelled
CI / test (macos-latest, 3.11) (push) Has been cancelled
CI / test (macos-latest, 3.12) (push) Has been cancelled
CI / test (ubuntu-latest, 3.10) (push) Has been cancelled
CI / test (ubuntu-latest, 3.11) (push) Has been cancelled
CI / test (ubuntu-latest, 3.12) (push) Has been cancelled
CI / test (windows-latest, 3.10) (push) Has been cancelled
CI / test (windows-latest, 3.11) (push) Has been cancelled
CI / test (windows-latest, 3.12) (push) Has been cancelled
This commit is contained in:
commit
612936a00b
540 changed files with 174136 additions and 0 deletions
40
tests/gui/test_constraint_and_display_dialogs.py
Normal file
40
tests/gui/test_constraint_and_display_dialogs.py
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
"""GUI tests for equalDOF and display-option dialogs."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
pytest.importorskip("PySide6")
|
||||
|
||||
from otko.views.dialogs.assign_equal_dof import AssignEqualDOFDialog
|
||||
from otko.views.dialogs.display_options import DisplayOptionsDialog
|
||||
|
||||
|
||||
@pytest.mark.gui
|
||||
def test_assign_equal_dof_dialog_requires_explicit_dof_choice(qtbot) -> None: # type: ignore[no-untyped-def]
|
||||
dlg = AssignEqualDOFDialog([3, 4], ndf=3)
|
||||
qtbot.addWidget(dlg)
|
||||
|
||||
with pytest.raises(ValueError, match="at least one DOF"):
|
||||
dlg.constraint()
|
||||
|
||||
dlg2 = AssignEqualDOFDialog([3, 4], ndf=3, suggested_dofs=(2, 3))
|
||||
qtbot.addWidget(dlg2)
|
||||
|
||||
c = dlg2.constraint()
|
||||
assert c.retained_node == 3
|
||||
assert c.constrained_node == 4
|
||||
assert c.dofs == (2, 3)
|
||||
|
||||
|
||||
@pytest.mark.gui
|
||||
def test_display_options_dialog_round_trip(qtbot) -> None: # type: ignore[no-untyped-def]
|
||||
dlg = DisplayOptionsDialog(
|
||||
show_node_labels=False,
|
||||
show_element_labels=True,
|
||||
)
|
||||
qtbot.addWidget(dlg)
|
||||
|
||||
dlg._show_node_labels.setChecked(True)
|
||||
dlg._show_element_labels.setChecked(False)
|
||||
assert dlg.values() == (True, False)
|
||||
Loading…
Reference in a new issue