MCPcopy Index your code
hub / github.com/google/adk-python / FakeRunner

Class FakeRunner

tests/unittests/a2a/integration/server.py:35–58  ·  view source on GitHub ↗

A Fake Runner that delegates run_async to a provided function.

Source from the content-addressed store, hash-verified

33
34
35class FakeRunner(Runner):
36 """A Fake Runner that delegates run_async to a provided function."""
37
38 def __init__(self, run_async_fn):
39 agent = Mock(spec=BaseAgent)
40 agent.name = "FakeAgent"
41
42 session_service = InMemorySessionService()
43 super().__init__(
44 app_name="FakeApp",
45 agent=agent,
46 session_service=session_service,
47 )
48 self.run_async_fn = run_async_fn
49
50 mock_artifact_service = Mock()
51 mock_artifact_service.load_artifact = AsyncMock(
52 return_value=types.Part(text="artifact content")
53 )
54 self.artifact_service = mock_artifact_service
55
56 async def run_async(self, **kwargs):
57 async for event in self.run_async_fn(**kwargs):
58 yield event
59
60
61agent_card = AgentCard(

Callers 1

create_server_appFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected