新增征信解析接口与错误模拟

This commit is contained in:
wkc
2026-03-23 15:21:06 +08:00
parent 397bd07e1c
commit d7f34f009d
4 changed files with 165 additions and 1 deletions

View File

@@ -0,0 +1,45 @@
def test_html_eval_should_return_credit_payload(client, sample_credit_html_file):
response = client.post(
"/xfeature-mngs/conversation/htmlEval",
data={"model": "LXCUSTALL", "hType": "PERSON"},
files={"file": sample_credit_html_file},
)
assert response.status_code == 200
data = response.json()
assert data["status_code"] == "0"
assert data["message"] == "成功"
assert "lx_header" in data["payload"]
def test_html_eval_should_return_err_99999_for_missing_model(client, sample_credit_html_file):
response = client.post(
"/xfeature-mngs/conversation/htmlEval",
data={"hType": "PERSON"},
files={"file": sample_credit_html_file},
)
assert response.status_code == 200
assert response.json()["status_code"] == "ERR_99999"
def test_html_eval_should_return_err_10003_for_invalid_h_type(client, sample_credit_html_file):
response = client.post(
"/xfeature-mngs/conversation/htmlEval",
data={"model": "LXCUSTALL", "hType": "JSON"},
files={"file": sample_credit_html_file},
)
assert response.status_code == 200
assert response.json()["status_code"] == "ERR_10003"
def test_html_eval_should_support_debug_error_marker(client, sample_credit_html_file):
response = client.post(
"/xfeature-mngs/conversation/htmlEval",
data={"model": "error_ERR_10001", "hType": "PERSON"},
files={"file": sample_credit_html_file},
)
assert response.status_code == 200
assert response.json()["status_code"] == "ERR_10001"