Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,13 @@

from setup_utils import get_dynamic_dependencies # noqa: E402

# Use minimum version strategy:
# - Internal packages get: >= current_base_version (e.g., >= 0.1.0)
# - Automatically updates when you build new versions
# - Consumers can upgrade to any higher version
# Use exact version matching for internal dependencies:
# - Internal packages get: == current_version (e.g., == 1.2.3)
# - Ensures all SDK packages must be at the same version
# - Prevents incompatibility issues from version mismatches
setup(
version=package_version,
install_requires=get_dynamic_dependencies(
use_compatible_release=False, # No upper bound
use_exact_match=False, # Not exact match
use_exact_match=True,
),
)
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
class TestMcpToolRegistrationServiceInit:
"""Tests for McpToolRegistrationService initialization."""

@pytest.mark.unit
def test_init_default_logger(self):
"""Test initialization with default logger."""
with patch(
Expand All @@ -24,6 +25,7 @@ def test_init_default_logger(self):
assert service.config_service is not None
assert service._connected_servers == []

@pytest.mark.unit
def test_init_custom_logger(self):
"""Test initialization with custom logger."""
import logging
Expand All @@ -39,6 +41,7 @@ def test_init_custom_logger(self):

assert service._logger is custom_logger

@pytest.mark.unit
def test_orchestrator_name(self):
"""Test that orchestrator name is set correctly."""
with patch(
Expand Down Expand Up @@ -91,6 +94,7 @@ def mock_server_config(self):
return mock

@pytest.mark.asyncio
@pytest.mark.unit
async def test_add_tool_servers_exchanges_token_when_not_provided(
self, mock_agent, mock_authorization, mock_turn_context
):
Expand Down Expand Up @@ -136,6 +140,7 @@ async def test_add_tool_servers_exchanges_token_when_not_provided(
mock_authorization.exchange_token.assert_called_once()

@pytest.mark.asyncio
@pytest.mark.unit
async def test_add_tool_servers_uses_provided_token(
self, mock_agent, mock_authorization, mock_turn_context
):
Expand Down Expand Up @@ -178,6 +183,7 @@ async def test_add_tool_servers_uses_provided_token(
mock_authorization.exchange_token.assert_not_called()

@pytest.mark.asyncio
@pytest.mark.unit
async def test_add_tool_servers_creates_mcp_toolsets(
self, mock_agent, mock_authorization, mock_turn_context, mock_server_config
):
Expand Down Expand Up @@ -227,6 +233,7 @@ async def test_add_tool_servers_creates_mcp_toolsets(
assert mock_toolset in service._connected_servers

@pytest.mark.asyncio
@pytest.mark.unit
async def test_add_tool_servers_returns_new_agent(
self, mock_agent, mock_authorization, mock_turn_context
):
Expand Down Expand Up @@ -276,6 +283,7 @@ async def test_add_tool_servers_returns_new_agent(
)

@pytest.mark.asyncio
@pytest.mark.unit
async def test_add_tool_servers_handles_toolset_creation_error(
self, mock_agent, mock_authorization, mock_turn_context, mock_server_config
):
Expand Down Expand Up @@ -329,6 +337,7 @@ class TestCleanup:
"""Tests for cleanup method."""

@pytest.mark.asyncio
@pytest.mark.unit
async def test_cleanup_closes_connected_servers(self):
"""Test that cleanup closes all connected servers."""
with patch(
Expand All @@ -355,6 +364,7 @@ async def test_cleanup_closes_connected_servers(self):
assert service._connected_servers == []

@pytest.mark.asyncio
@pytest.mark.unit
async def test_cleanup_handles_close_errors(self):
"""Test that cleanup handles errors during close gracefully."""
with patch(
Expand All @@ -377,6 +387,7 @@ async def test_cleanup_handles_close_errors(self):
assert service._connected_servers == []

@pytest.mark.asyncio
@pytest.mark.unit
async def test_cleanup_handles_servers_without_close(self):
"""Test that cleanup handles servers without close method."""
with patch(
Expand Down