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"] assert data["payload"]["lx_header"]["query_cust_name"] == "测试员工" assert data["payload"]["lx_header"]["query_cert_no"] == "320101199001010030" 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"