|
3 | 3 |
|
4 | 4 | """Unit tests for send_chat_history_from_store methods in McpToolRegistrationService.""" |
5 | 5 |
|
6 | | -# Direct import from service file to work around namespace package resolution issues |
7 | | -# with editable installs in the uv workspace |
8 | | -import importlib.util |
9 | | -import sys |
10 | | -from pathlib import Path |
11 | | - |
12 | | -_service_path = ( |
13 | | - Path(__file__).parent.parent.parent.parent.parent.parent |
14 | | - / "libraries" |
15 | | - / "microsoft-agents-a365-tooling-extensions-agentframework" |
16 | | - / "microsoft_agents_a365" |
17 | | - / "tooling" |
18 | | - / "extensions" |
19 | | - / "agentframework" |
20 | | - / "services" |
21 | | - / "mcp_tool_registration_service.py" |
| 6 | +import uuid |
| 7 | +from datetime import UTC, datetime |
| 8 | +from unittest.mock import AsyncMock, Mock, patch |
| 9 | + |
| 10 | +import pytest |
| 11 | +from microsoft_agents.hosting.core import TurnContext |
| 12 | +from microsoft_agents_a365.runtime import OperationError, OperationResult |
| 13 | +from microsoft_agents_a365.tooling.extensions.agentframework.services import ( |
| 14 | + McpToolRegistrationService, |
22 | 15 | ) |
23 | | -_spec = importlib.util.spec_from_file_location("mcp_tool_registration_service", _service_path) |
24 | | -_module = importlib.util.module_from_spec(_spec) |
25 | | -sys.modules["mcp_tool_registration_service"] = _module |
26 | | -_spec.loader.exec_module(_module) |
27 | | -McpToolRegistrationService = _module.McpToolRegistrationService |
28 | | - |
29 | | -import uuid # noqa: E402 |
30 | | -from datetime import UTC, datetime # noqa: E402 |
31 | | -from unittest.mock import AsyncMock, Mock, patch # noqa: E402 |
32 | | - |
33 | | -import pytest # noqa: E402 |
34 | | -from microsoft_agents.hosting.core import TurnContext # noqa: E402 |
35 | | -from microsoft_agents_a365.runtime import OperationError, OperationResult # noqa: E402 |
36 | | -from microsoft_agents_a365.tooling.models import ToolOptions # noqa: E402 |
| 16 | +from microsoft_agents_a365.tooling.models import ToolOptions |
37 | 17 |
|
38 | 18 |
|
39 | 19 | class TestSendChatHistoryAsync: |
|
0 commit comments