MCPcopy Create free account
hub / github.com/Tron521/codex-console-temp / CaptureSession

Class CaptureSession

tests/test_registration_sentinel_flow.py:41–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39
40
41class CaptureSession:
42 def __init__(self, responses):
43 self.responses = list(responses)
44 self.calls = []
45 self.cookies = {"oai-did": "device-fixed"}
46
47 def post(self, url, **kwargs):
48 self.calls.append({"method": "POST", "url": url, "kwargs": kwargs})
49 if not self.responses:
50 raise AssertionError(f"unexpected POST {url}")
51 return self.responses.pop(0)
52
53 def get(self, url, **kwargs):
54 self.calls.append({"method": "GET", "url": url, "kwargs": kwargs})
55 if not self.responses:
56 raise AssertionError(f"unexpected GET {url}")
57 return self.responses.pop(0)
58
59
60def _header_value(headers, name: str):

Calls

no outgoing calls