File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/amazon-keyspaces-mcp-server/tests Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 1515
1616import inspect
1717from awslabs .amazon_keyspaces_mcp_server .server import main
18- from unittest .mock import patch
18+ from unittest .mock import AsyncMock , patch
1919
2020
2121class TestMain :
2222 """Tests for the main function."""
2323
2424 @patch ('awslabs.amazon_keyspaces_mcp_server.server.mcp.run' )
25+ @patch ('awslabs.amazon_keyspaces_mcp_server.client.UnifiedCassandraClient.get_session' )
2526 @patch ('sys.argv' , ['awslabs.amazon-keyspaces-mcp-server' ])
26- def test_main_default (self , mock_run ):
27+ def test_main_default (self , mock_get_session , mock_run ):
2728 """Test main function with default arguments.
2829
2930 This test verifies that:
3031 1. The main function runs without errors
3132 2. The mcp.run method is called once
3233 3. No transport parameter is passed to mcp.run
3334 """
35+ mock_get_session .return_value = AsyncMock ()
3436 main ()
3537 mock_run .assert_called_once ()
3638 assert mock_run .call_args [1 ].get ('transport' ) is None
You can’t perform that action at this time.
0 commit comments