Snapshots the current development tree, headlined by proper load combinations (user request): a reusable LoadCombination entity of weighted completed static-case results (e.g. 1.2xDead + 1.6xLive). - core: LoadCombination/LoadCombinationItem entities, Project integration (lookup, unique ids, reference validation) - services: combinations.py (linear superposition + envelope), exported via services __init__ - commands: undoable Add/Delete/Update for combinations - GUI: Load Combinations manager dialog, Run-dialog evaluation, envelope display in Results panel, Combinations tab in Table dock - tests: unit coverage (validation, math, error paths) + integration superposition check vs a single factored run
45 lines
1.3 KiB
Python
45 lines
1.3 KiB
Python
"""GUI tests for Define dialogs."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import pytest
|
|
|
|
pytest.importorskip("PySide6")
|
|
|
|
from otko.core import LinearTimeSeries, Project # noqa: E402
|
|
from otko.views.dialogs.linear_time_series import LinearTimeSeriesDialog # noqa: E402
|
|
from otko.views.dialogs.plain_pattern import PlainPatternDialog # noqa: E402
|
|
|
|
|
|
@pytest.mark.gui
|
|
def test_linear_time_series_dialog_builds_entity(qtbot) -> None: # type: ignore[no-untyped-def]
|
|
dlg = LinearTimeSeriesDialog(next_ts_id=3)
|
|
qtbot.addWidget(dlg)
|
|
|
|
dlg._name_edit.setText("Gravity")
|
|
dlg._factor_spin.setValue(1.5)
|
|
|
|
ts = dlg.time_series()
|
|
assert ts.id == 3
|
|
assert ts.name == "Gravity"
|
|
assert ts.factor == pytest.approx(1.5)
|
|
|
|
|
|
@pytest.mark.gui
|
|
def test_plain_pattern_dialog_uses_selected_time_series(qtbot) -> None: # type: ignore[no-untyped-def]
|
|
proj = Project(
|
|
time_series=[
|
|
LinearTimeSeries(id=1, name="GravityTS"),
|
|
LinearTimeSeries(id=2, name="RampTS"),
|
|
]
|
|
)
|
|
dlg = PlainPatternDialog(project=proj, next_pattern_id=4)
|
|
qtbot.addWidget(dlg)
|
|
|
|
dlg._name_edit.setText("Gravity")
|
|
dlg._ts_cb.setCurrentIndex(1)
|
|
|
|
pat = dlg.pattern()
|
|
assert pat.id == 4
|
|
assert pat.name == "Gravity"
|
|
assert pat.time_series_id == 2
|