Fix tag graph test
All checks were successful
CI / test (push) Successful in 3m30s
Lint / test (push) Successful in 27s
Trivy / test (push) Successful in 21s

This commit is contained in:
Miguel Jacq 2025-11-19 12:38:35 +11:00
parent 85e2a93199
commit 4db40e6b4b
Signed by: mig5
GPG key ID: 59B3F0C24135C6A9

View file

@ -320,10 +320,10 @@ def test_tag_graph_dialog_on_positions_changed_updates_labels_and_halo(
pos = np.array([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]], dtype=float) pos = np.array([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]], dtype=float)
dlg._on_positions_changed(pos) dlg._on_positions_changed(pos)
# Each label should be slightly below its node (y + 0.30) # Each label should be slightly below its node (y + 0.15)
for i, label in enumerate(dlg._label_items): for i, label in enumerate(dlg._label_items):
assert label.pos().x() == pytest.approx(pos[i, 0]) assert label.pos().x() == pytest.approx(pos[i, 0])
assert label.pos().y() == pytest.approx(pos[i, 1] + 0.30) assert label.pos().y() == pytest.approx(pos[i, 1] + 0.15)
# Halo layer should receive the updated coordinates and our sizes/brushes # Halo layer should receive the updated coordinates and our sizes/brushes
assert captured["x"] == [1.0, 3.0, 5.0] assert captured["x"] == [1.0, 3.0, 5.0]