Skip to content

Commit e4ee5f2

Browse files
test: Add tests for custom id generators
1 parent 3a45f32 commit e4ee5f2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/server/agent_execution/test_simple_request_context_builder.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,8 @@ async def test_build_populate_false_with_reference_task_ids(self) -> None:
280280
async def test_build_with_custom_id_generators(self) -> None:
281281
mock_task_id_generator = AsyncMock(spec=IDGenerator)
282282
mock_context_id_generator = AsyncMock(spec=IDGenerator)
283+
mock_task_id_generator.generate.return_value = 'custom_task_id'
284+
mock_context_id_generator.generate.return_value = 'custom_context_id'
283285

284286
builder = SimpleRequestContextBuilder(
285287
should_populate_referred_tasks=False,
@@ -300,6 +302,8 @@ async def test_build_with_custom_id_generators(self) -> None:
300302

301303
mock_task_id_generator.generate.assert_called_once()
302304
mock_context_id_generator.generate.assert_called_once()
305+
self.assertEqual(request_context.task_id, 'custom_task_id')
306+
self.assertEqual(request_context.context_id, 'custom_context_id')
303307

304308
async def test_build_with_provided_ids_and_custom_id_generators(self) -> None:
305309
mock_task_id_generator = AsyncMock(spec=IDGenerator)

0 commit comments

Comments
 (0)