INNER CODE UNIT · Python
fake_get
Fausto-404/js-reverse-automation--skill · js-reverse-automation/scripts/check_delivery_contract.py:32
def fake_get(url: str, **_: Any) -> FakeResponse:
calls.append(url)
return FakeResponse()
original_get = module.requests.get
try:
module.requests.get = fake_get
transform = module.CONFIG["transforms"][0]
module.jsrpc_call(transform.get("action", module.CONFIG["jsrpc"]["action"]), "123456", transform)
finally:
module.requests.get = original_get
if len(calls) != 1 or not calls[0].endswith("/go") or calls[0].endswith("/go/go"):
raise AssertionError(f"JSRPC endpoint 归一化失败:{calls}")
return {"ok": True, "called": calls[0]}
def check_packet_modes(module) -> dict[str, Any]: