MCPcopy Create free account
hub / github.com/anthropics/anthropic-sdk-python / _FakeClient

Class _FakeClient

tests/lib/tools/test_session_runner.py:287–306  ·  view source on GitHub ↗

Minimal stand-in for `AsyncAnthropic` — only exposes the resource path the runner reads.

Source from the content-addressed store, hash-verified

285
286
287class _FakeClient:
288 """Minimal stand-in for `AsyncAnthropic` — only exposes the resource path
289 the runner reads."""
290
291 _tracer = None
292
293 def __init__(self, events: FakeAsyncEvents) -> None:
294 self.beta = type(
295 "_Beta",
296 (),
297 {"sessions": type("_Sessions", (), {"events": events})()},
298 )()
299
300 @property
301 def open_telemetry(self) -> dict[str, Any]:
302 return {}
303
304 def with_options(self, **_options: Any) -> _FakeClient:
305 """The copy that sends a thread's tool results is this client: the fake events record every send."""
306 return self
307
308
309async def _run_with_fakes(

Calls

no outgoing calls