fix: list/search quickSearch 参数名修正 + SQL 方言友好报错 + E071 传输请求改 IN
- list_objects: maxrow/name/type 改为 operation=quickSearch/query/maxResults/objectType, 并剥离 NW 7.40/7.50 quickSearch name 里的本地化类型标签(如 "ZCL_FOO (Class)") - query_table_data: HTTP 400 转抛 SapCliError,说明方言限制(WHERE 仅 IN/LIKE),不再打堆栈 - _query_transport_request: E071 查询 WHERE 改用 IN(...),区分「无」与「无法获取」
This commit is contained in:
@@ -19,7 +19,7 @@ sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), ".."
|
||||
|
||||
from sapcli.client import ADTClient
|
||||
from sapcli.client._ddic import _local, _attr_local, _find_local
|
||||
from sapcli.exceptions import CreateError, DeleteError
|
||||
from sapcli.exceptions import CreateError, DeleteError, SapCliError
|
||||
from sapcli.types import parse_object_name
|
||||
|
||||
# ADT XML 命名空间
|
||||
@@ -706,6 +706,14 @@ class TestQueryTableData(unittest.TestCase):
|
||||
self.assertEqual(result["rows"], [])
|
||||
self.assertEqual(result["total_rows"], 0)
|
||||
|
||||
def test_http_400_raises_friendly_error(self):
|
||||
client = _make_client()
|
||||
client.session.post.return_value = _mock_resp(400, text="A Boolean expression was expected")
|
||||
with self.assertRaises(SapCliError) as ctx:
|
||||
client.query_table_data("SELECT * FROM t WHERE f='x'")
|
||||
self.assertIn("IN", str(ctx.exception))
|
||||
self.assertIn("LIKE", str(ctx.exception))
|
||||
|
||||
|
||||
# ═══════════════════════════════════════════
|
||||
# run_program
|
||||
|
||||
Reference in New Issue
Block a user