Helper to set up test context with common defaults. Args: tool_manager: Optional tool manager to use **kwargs: Additional context parameters Returns: The initialized ApplicationContext
(tool_manager=None, **kwargs)
| 14 | |
| 15 | |
| 16 | def setup_test_context(tool_manager=None, **kwargs): |
| 17 | """ |
| 18 | Helper to set up test context with common defaults. |
| 19 | |
| 20 | Args: |
| 21 | tool_manager: Optional tool manager to use |
| 22 | **kwargs: Additional context parameters |
| 23 | |
| 24 | Returns: |
| 25 | The initialized ApplicationContext |
| 26 | """ |
| 27 | # Reset first to ensure clean state |
| 28 | ContextManager().reset() |
| 29 | |
| 30 | # Set defaults if not provided |
| 31 | if "provider" not in kwargs: |
| 32 | kwargs["provider"] = "openai" |
| 33 | if "model" not in kwargs: |
| 34 | kwargs["model"] = "gpt-4" |
| 35 | |
| 36 | # Initialize with test defaults |
| 37 | context = initialize_context(tool_manager=tool_manager, **kwargs) |
| 38 | |
| 39 | return context |
nothing calls this directly
no test coverage detected