@@ -24,15 +24,15 @@ def test_main_with_valid_transport():
2424 with patch ("aws_mcp_server.__main__.mcp.run" ) as mock_run :
2525 # We can't easily test the full __main__ module execution
2626 from aws_mcp_server .__main__ import mcp
27-
27+
2828 # Instead, we'll test the specific function we modified
2929 with patch ("aws_mcp_server.__main__.logger" ) as mock_logger :
3030 # Import the function to ensure proper validation
3131 from aws_mcp_server .__main__ import TRANSPORT
32-
32+
3333 # Call the relevant function directly
3434 mcp .run (transport = TRANSPORT )
35-
35+
3636 # Check that mcp.run was called with the correct transport
3737 mock_run .assert_called_once_with (transport = "stdio" )
3838 # Verify logger was called
@@ -43,7 +43,7 @@ def test_main_transport_validation():
4343 """Test transport protocol validation."""
4444 with patch ("aws_mcp_server.config.TRANSPORT" , "invalid" ):
4545 from aws_mcp_server .config import TRANSPORT
46-
46+
4747 # Test the main function's validation logic
4848 with patch ("aws_mcp_server.server.mcp.run" ) as mock_run :
4949 with patch ("sys.exit" ) as mock_exit :
@@ -54,12 +54,10 @@ def test_main_transport_validation():
5454 mock_exit (1 )
5555 else :
5656 mock_run (transport = TRANSPORT )
57-
57+
5858 # Check that error was logged with invalid transport
59- mock_logger .error .assert_called_once_with (
60- "Invalid transport protocol: invalid. Must be 'stdio' or 'sse'"
61- )
59+ mock_logger .error .assert_called_once_with ("Invalid transport protocol: invalid. Must be 'stdio' or 'sse'" )
6260 # Check that exit was called
6361 mock_exit .assert_called_once_with (1 )
6462 # Check that mcp.run was not called
65- mock_run .assert_not_called ()
63+ mock_run .assert_not_called ()
0 commit comments