holy fuking shit
This commit is contained in:
@@ -29,7 +29,7 @@ class LocalSimTransport(Transport):
|
||||
def post(self, url, body, headers, timeout):
|
||||
return self.request("POST", url, body, headers, timeout)
|
||||
|
||||
def request(self, method, url, body, headers, timeout=None):
|
||||
def request(self, method, url, body, headers, _timeout=None):
|
||||
"""验证原始请求边界;内存回环不模拟 TCP、UI 或连接限流。"""
|
||||
target = urlsplit(url)
|
||||
raw_target = target.path + (f"?{target.query}" if target.query else "")
|
||||
@@ -57,5 +57,6 @@ class ScriptedFaultTransport(Transport):
|
||||
self.inner.post(url, body, headers, timeout) # 服务器已受理
|
||||
raise TransportError("injected: read timeout after server applied")
|
||||
if isinstance(fault, tuple) and fault and fault[0] == "status":
|
||||
return TransportResponse(int(fault[1]), b'{"accepted": false, "real_timestamp_ms": 0, "virtual_time_s": 0}')
|
||||
body = b'{"accepted": false, "real_timestamp_ms": 0, "virtual_time_s": 0}'
|
||||
return TransportResponse(int(fault[1]), body)
|
||||
return self.inner.post(url, body, headers, timeout)
|
||||
|
||||
Reference in New Issue
Block a user