|
|
|
@ -989,6 +989,35 @@ class AutoRoutingTest(unittest.TestCase):
|
|
|
|
self.assertIn("端子匹配失败", message)
|
|
|
|
self.assertIn("端子匹配失败", message)
|
|
|
|
self.assertIn("local:", message)
|
|
|
|
self.assertIn("local:", message)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_route_all_report_includes_network_and_first_error(self):
|
|
|
|
|
|
|
|
_install_fake_freecad()
|
|
|
|
|
|
|
|
_terminal_objects, _wiring_objects, _routing_network, auto_routing = _reload_modules()
|
|
|
|
|
|
|
|
report = {
|
|
|
|
|
|
|
|
"total_wires": 2,
|
|
|
|
|
|
|
|
"routed": 1,
|
|
|
|
|
|
|
|
"collision_warnings": 1,
|
|
|
|
|
|
|
|
"skipped_missing_terminal": 1,
|
|
|
|
|
|
|
|
"prepared_layout": {
|
|
|
|
|
|
|
|
"wire_duct_carriers": 2,
|
|
|
|
|
|
|
|
"surface_carriers": 4,
|
|
|
|
|
|
|
|
"terminal_access_carriers": 6,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"missing_endpoint_samples": [
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
"start_terminal_uuid": "terminal-a",
|
|
|
|
|
|
|
|
"end_terminal_uuid": "terminal-b",
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
"errors": ["没有可用的线槽/路由路径网络"],
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
message = auto_routing.format_route_all_report(report)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.assertIn("routed=1", message)
|
|
|
|
|
|
|
|
self.assertIn("线槽路径 2 条", message)
|
|
|
|
|
|
|
|
self.assertIn("首个错误:没有可用的线槽/路由路径网络", message)
|
|
|
|
|
|
|
|
self.assertIn("缺失示例:terminal-a -> terminal-b", message)
|
|
|
|
|
|
|
|
|
|
|
|
def test_bind_wire_task_terminals_from_payload_does_not_create_wires(self):
|
|
|
|
def test_bind_wire_task_terminals_from_payload_does_not_create_wires(self):
|
|
|
|
_install_fake_freecad()
|
|
|
|
_install_fake_freecad()
|
|
|
|
terminal_objects, wiring_objects, _routing_network, auto_routing = _reload_modules()
|
|
|
|
terminal_objects, wiring_objects, _routing_network, auto_routing = _reload_modules()
|
|
|
|
|