Skip to content

Commit da1407d

Browse files
committed
test: fix Windows-specific tests and incorrect mock patches
Skip TestFindCommandRobustNodePaths on non-Windows platforms since it tests Windows file paths. Correct mock patches to use find_command_robust instead of find_command in MCP server configuration tests.
1 parent 778f3a1 commit da1407d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

tests/test_setup_environment.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2971,6 +2971,7 @@ def test_windows_node_not_found(self, mock_find_robust, mock_which, mock_system,
29712971
assert 'Node.js not found in PATH' in captured.err
29722972

29732973

2974+
@pytest.mark.skipif(sys.platform != 'win32', reason='Windows-specific test')
29742975
class TestFindCommandRobustNodePaths:
29752976
"""Test find_command_robust with various Node.js installation paths."""
29762977

tests/test_setup_environment_additional.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ def test_configure_mcp_server_claude_not_found(self, mock_exists, mock_find, _mo
568568
assert result is False
569569

570570
@patch('platform.system', return_value='Windows')
571-
@patch('setup_environment.find_command', return_value=None)
571+
@patch('setup_environment.find_command_robust', return_value='claude')
572572
def test_configure_mcp_server_find_in_npm_path(self, mock_find, mock_system):
573573
"""Test finding claude in npm path on Windows."""
574574
del mock_find # Unused but required for patch
@@ -588,7 +588,7 @@ def test_configure_mcp_server_find_in_npm_path(self, mock_find, mock_system):
588588
assert mock_run.call_count == 4
589589

590590
@patch('platform.system', return_value='Linux')
591-
@patch('setup_environment.find_command', return_value=None)
591+
@patch('setup_environment.find_command_robust', return_value='claude')
592592
def test_configure_mcp_server_find_in_unix_paths(self, mock_find, _mock_system):
593593
"""Test finding claude in Unix paths."""
594594
del mock_find # Unused but required for patch

0 commit comments

Comments
 (0)