fix: harden supervised replacement and missing uid handling

This commit is contained in:
阿白叔 committed 2026-10-30 16:33:10 +08:00
1 parent 656f43e2ff
commit 131b6dbbb3
30 files changed
+1655 -92

No files matched your search

@@ -180,7 +180,7 @@ class NativeTests(unittest.TestCase):
component = type("Component", (), {"UID": "uid", "Refdes": "R1"})()
records = [["C", "uid", "R1"]]
def value(_component, name):
def value(_component, name, *, required=False, fallback=""):
return {"Part Number": "NEW", "Part Name": "RES", "Part Label": ""}[name]
with patch.object(native, "attribute_value", side_effect=value):
@@ -117,7 +117,7 @@ def test_quick_part_replace_prioritizes_recovery_and_preflights_before_writes()
assert '"hard_failure"' in text
assert "multiple awaiting_native_replace rules" in text
assert text.index("QPRestorePreflight") < text.index("Comp.Refdes =")
assert "Cannot capture " in text
assert "optional_display_field_unavailable field=" in text
assert "QPOptionalAttributeField" in text
assert "value_style_defaulted" in text
assert 'QP_App.ExecuteCommand("undo")' in text