List saved object calibrations immediately

This commit is contained in:
Ayzen
2026-10-06 19:36:00 +03:00
parent cfe81f782b
commit 4633a92144
3 changed files with 18 additions and 11 deletions
@@ -258,12 +258,14 @@ class ObjectCaptureLifecycleTest(unittest.TestCase):
metadata = {"provenance": provenance, "targets": [], "diagnostics": [],
"tx_output_pos": [1, 3], "rx_input_pos": [0, 2]}
self.dialog.add_capture([_through()], captured.to_dict(), provenance)
for name, error in (("matching", None), ("changed", None),
for name, error in (("matching", None), ("changed", None), ("unvalidated", None),
("cancelled", InterruptedError("cancelled")), ("failed", ValueError("bad input"))):
with self.subTest(outcome=name):
self.config = captured.clone()
if name == "changed":
self.config.radar.sweep.points += 1
if name == "unvalidated": # Same radar key, but the selected through set is gone.
self.config.preprocess.s21.calibration.set_name = "absent"
self.dialog._set_name_input.setText(name)
with mock.patch.object(self.dialog, "calculation_inputs", return_value=([], captured.to_dict(), {}, provenance)), \
mock.patch("python_app.workflows.mimo_calibration.compute_from_collections",
@@ -284,6 +286,9 @@ class ObjectCaptureLifecycleTest(unittest.TestCase):
self.assertEqual(saved_meta["provenance"], provenance)
self.assertEqual(len(saved.traces), 4)
expected = {"matching": "Applies on the next Start", "changed": "Not selected",
"cancelled": "cancelled", "failed": "failed"}
"unvalidated": "Not selected", "cancelled": "cancelled", "failed": "failed"}
self.assertIn(expected[name], self.dialog._status_label.text())
if name in ("matching", "unvalidated"): # Listed at once, without reopening the dialog.
combo = self.preprocess.ensure_dialog()._set_combos["s21_object_calibration"]
self.assertGreaterEqual(combo.findData(name), 0)
self.error.assert_called_once()