mirror of
https://github.com/encounter/adk-python.git
synced 2026-07-09 18:19:28 -07:00
feat: Skip running a workflow agent if it has no sub-agents
PiperOrigin-RevId: 811528166
This commit is contained in:
committed by
Copybara-Service
parent
b2b80e7fa0
commit
2c752934a8
@@ -91,6 +91,20 @@ async def test_run_async(request: pytest.FixtureRequest):
|
||||
assert events[1].content.parts[0].text == f'Hello, async {agent_2.name}!'
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_run_async_skip_if_no_sub_agent(request: pytest.FixtureRequest):
|
||||
sequential_agent = SequentialAgent(
|
||||
name=f'{request.function.__name__}_test_agent',
|
||||
sub_agents=[],
|
||||
)
|
||||
parent_ctx = await _create_parent_invocation_context(
|
||||
request.function.__name__, sequential_agent
|
||||
)
|
||||
events = [e async for e in sequential_agent.run_async(parent_ctx)]
|
||||
|
||||
assert not events
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_run_live(request: pytest.FixtureRequest):
|
||||
agent_1 = _TestingAgent(name=f'{request.function.__name__}_test_agent_1')
|
||||
|
||||
Reference in New Issue
Block a user