Skip to content

Commit 76790f1

Browse files
Copilotpontemonti
andcommitted
Run ruff formatter to fix formatting issues
Co-authored-by: pontemonti <7850950+pontemonti@users.noreply.github.com>
1 parent 5cec8d5 commit 76790f1

3 files changed

Lines changed: 18 additions & 6 deletions

File tree

libraries/microsoft-agents-a365-tooling-extensions-agentframework/microsoft_agents_a365/tooling/extensions/agentframework/services/mcp_tool_registration_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ async def add_tool_servers_to_agent(
9898
for config in server_configs:
9999
# Use mcp_server_name if available (not None or empty), otherwise fall back to mcp_server_unique_name
100100
server_name = config.mcp_server_name or config.mcp_server_unique_name
101-
101+
102102
try:
103103
# Prepare auth headers
104104
headers = {}

libraries/microsoft-agents-a365-tooling/microsoft_agents_a365/tooling/services/mcp_tool_server_configuration_service.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,9 @@ def _parse_manifest_server_config(
408408
final_url = endpoint if endpoint else build_mcp_server_url(server_name)
409409

410410
return MCPServerConfig(
411-
mcp_server_name=mcp_server_name, mcp_server_unique_name=mcp_server_unique_name, url=final_url
411+
mcp_server_name=mcp_server_name,
412+
mcp_server_unique_name=mcp_server_unique_name,
413+
url=final_url,
412414
)
413415

414416
except Exception:
@@ -442,7 +444,11 @@ def _parse_gateway_server_config(
442444
# Determine the final URL: use custom URL if provided, otherwise construct it
443445
final_url = endpoint if endpoint else build_mcp_server_url(server_name)
444446

445-
return MCPServerConfig(mcp_server_name=mcp_server_name, mcp_server_unique_name=mcp_server_unique_name, url=final_url)
447+
return MCPServerConfig(
448+
mcp_server_name=mcp_server_name,
449+
mcp_server_unique_name=mcp_server_unique_name,
450+
url=final_url,
451+
)
446452

447453
except Exception:
448454
return None

tests/tooling/test_mcp_server_configuration.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ def test_parse_manifest_server_config_with_custom_url(self, service):
104104
assert config.mcp_server_unique_name == "custom_server"
105105
assert config.url == "https://my.custom.server/mcp"
106106

107-
@patch("microsoft_agents_a365.tooling.services.mcp_tool_server_configuration_service.build_mcp_server_url")
107+
@patch(
108+
"microsoft_agents_a365.tooling.services.mcp_tool_server_configuration_service.build_mcp_server_url"
109+
)
108110
def test_parse_manifest_server_config_without_custom_url(self, mock_build_url, service):
109111
"""Test parsing manifest config without custom URL constructs URL."""
110112
mock_build_url.return_value = "https://default.server/agents/servers/DefaultServer"
@@ -139,7 +141,9 @@ def test_parse_gateway_server_config_with_custom_url(self, service):
139141
assert config.mcp_server_unique_name == "gateway_server_endpoint"
140142
assert config.url == "https://gateway.custom.url/mcp"
141143

142-
@patch("microsoft_agents_a365.tooling.services.mcp_tool_server_configuration_service.build_mcp_server_url")
144+
@patch(
145+
"microsoft_agents_a365.tooling.services.mcp_tool_server_configuration_service.build_mcp_server_url"
146+
)
143147
def test_parse_gateway_server_config_without_custom_url(self, mock_build_url, service):
144148
"""Test parsing gateway config without custom URL."""
145149
mock_build_url.return_value = "https://default.server/agents/servers/GatewayServer"
@@ -190,7 +194,9 @@ async def test_list_tool_servers_development(self, mock_load_manifest, service):
190194
assert servers == mock_servers
191195
mock_load_manifest.assert_called_once()
192196

193-
@patch("microsoft_agents_a365.tooling.services.mcp_tool_server_configuration_service.get_tooling_gateway_for_digital_worker")
197+
@patch(
198+
"microsoft_agents_a365.tooling.services.mcp_tool_server_configuration_service.get_tooling_gateway_for_digital_worker"
199+
)
194200
@patch.dict(os.environ, {"ENVIRONMENT": "Production"})
195201
@pytest.mark.asyncio
196202
async def test_list_tool_servers_production_with_custom_url(self, mock_gateway_url, service):

0 commit comments

Comments
 (0)