test(shipping): 更新订单复核库存与通知流程测试
This commit is contained in:
1 parent
8ec028e6a3
commit
265a6e179a
168 files changed
+9420
-4613
No files matched your search
@@ -12,8 +12,6 @@ import hashlib
|
||||
import json
|
||||
import re
|
||||
import uuid
|
||||
from pathlib import Path
|
||||
import urllib.request
|
||||
from datetime import datetime
|
||||
from typing import Any
|
||||
|
||||
@@ -112,19 +110,6 @@ def _published_schema_version() -> ShippingOrderSchemaVersion | None:
|
||||
|
||||
def _published_field_config(field_id: str) -> dict[str, Any] | None:
|
||||
"""读取当前发布版本中的字段配置;识别定义和证据标准化均使用同一快照。"""
|
||||
# #region debug-point A/B/C/E:published-schema-state
|
||||
try:
|
||||
debug_env = Path(__file__).resolve().parents[5] / '.dbg' / 'shipping-customer-fingerprint-500.env'
|
||||
debug_values = {
|
||||
line.split('=', 1)[0]: line.split('=', 1)[1].strip()
|
||||
for line in debug_env.read_text(encoding='utf-8').splitlines()
|
||||
if '=' in line
|
||||
}
|
||||
published_rows = ShippingOrderSchemaVersion.query.filter_by(status='published').all()
|
||||
urllib.request.urlopen(urllib.request.Request(debug_values.get('DEBUG_SERVER_URL', 'http://127.0.0.1:7777/event'), data=json.dumps({'sessionId': debug_values.get('DEBUG_SESSION_ID', 'shipping-customer-fingerprint-500'), 'runId': 'post-fix', 'hypothesisId': 'A/B/C/E', 'location': 'identity_rules/service.py:114', 'msg': '[DEBUG] published schema rows before serializer lookup', 'data': {'field_id': field_id, 'count': len(published_rows), 'rows': [{'id': row.id, 'schema_id': row.schema_id, 'version': row.version, 'status': row.status} for row in published_rows]}}).encode(), headers={'Content-Type': 'application/json'}), timeout=1).read()
|
||||
except Exception:
|
||||
pass
|
||||
# #endregion
|
||||
published = _published_schema_version()
|
||||
return next((
|
||||
item for item in ((published.definition_json if published else {}) or {}).get('fields', [])
|
||||
|
||||
Reference in new issue
Block a user