from errors import LoginFailed, NodeError def test_node_error_carries_default_ui_code(): exc = NodeError("元素找不到") assert exc.error_code == "UI_ELEMENT_NOT_FOUND" assert exc.retryable is False assert exc.route_role == "OPS" def test_login_failed_is_retryable(): exc = LoginFailed("登录失败") assert exc.error_code == "SYS_LOGIN_FAIL" assert exc.retryable is True assert exc.route_role == "OPS"