type: 收敛测试 schemas 与协议层类型

This commit is contained in:
yml2213
2026-08-30 20:35:08 +08:00
parent 92dc461e52
commit c891ac982e
26 changed files with 1846 additions and 882 deletions
+1 -1
View File
@@ -54,7 +54,7 @@ class TestEliteLockExchange:
assert result["order_id"] == "5874"
assert result["exchange_id"] == "11098933"
assert self.client.csrf_token.call_count == 2
assert self.client.__dict__["csrf_token"].call_count == 2
create_call, pay_call = self.client._request_json.call_args_list
assert create_call.args[:3] == (
"post",
+3 -1
View File
@@ -80,7 +80,9 @@ class TestDouyuProxyMode:
# 每任务取新代理:_client 也会再 fetch 一次(客户端构造即取代理)
fake.fetch_new_proxy.return_value = "http://10.0.0.3:3128"
assert runner._proxies_for_task()["http"] == "http://10.0.0.3:3128"
refreshed = runner._proxies_for_task()
assert refreshed is not None
assert refreshed["http"] == "http://10.0.0.3:3128"
assert fake.fetch_new_proxy.call_count == 3
def test_api_mode_failure_falls_back_to_direct(self):
+1
View File
@@ -226,6 +226,7 @@ class TestHuyaAppLogin:
.filter(HuyaAccount.username == "mock_test_huya_user")
.first()
)
assert acc is not None
batch_req = HuyaPasswordLoginSelectedRequest(account_ids=[acc.id])
batch_resp = app_password_login_selected_accounts(
req=batch_req, db=self.session, current=self.admin
+2 -1
View File
@@ -11,6 +11,7 @@
import pytest
import base64
import json
import pytest
from pathlib import Path
from unittest.mock import patch
@@ -69,7 +70,7 @@ class TestParseResponse:
def test_parse_golden_evidence(self):
"""真实抓包模板响应必须可解析 (证据: evidence/dfp_chain_golden.json)。"""
if not CHAIN_FILE.exists():
self.skipTest("缺失 golden 注册链模板")
pytest.skip("缺失 golden 注册链模板")
data = json.loads(CHAIN_FILE.read_text(encoding="utf-8"))
resp = base64.b64decode(data["dfpReport"]["resp_b64"])
t1, t2, t5 = _parse_response(resp)
+5 -5
View File
@@ -96,11 +96,11 @@ class TestMigrationSmoke:
missing_columns = model_columns - db_columns
assert not missing_columns
db_indexes = {
index["name"]
for index in inspector.get_indexes(name)
if not index["name"].startswith("sqlite_autoindex")
}
db_indexes = set()
for index in inspector.get_indexes(name):
index_name = index["name"]
if index_name and not index_name.startswith("sqlite_autoindex"):
db_indexes.add(index_name)
all_db_indexes |= db_indexes
model_indexes = {
index.name for index in table.indexes if index.name