Skip to content

Commit a502a25

Browse files
committed
CM-61587 applied fix for python3.10 test failures
1 parent 64ff939 commit a502a25

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/cli/apps/mcp/test_mcp_command.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
if sys.version_info < (3, 10):
1010
pytest.skip('MCP requires Python 3.10+', allow_module_level=True)
1111

12+
import cycode.cli.apps.mcp.mcp_command as mcp_module
1213
from cycode.cli.apps.mcp.mcp_command import (
1314
_build_scan_summary,
1415
_sanitize_file_path,
@@ -325,7 +326,7 @@ async def test_cycode_scan_tool_paths_valid_invokes_scan() -> None:
325326

326327
with (
327328
tempfile.TemporaryDirectory() as tmpdir,
328-
patch('cycode.cli.apps.mcp.mcp_command._run_cycode_scan', return_value=scan_result) as mock_scan,
329+
patch.object(mcp_module, '_run_cycode_scan', return_value=scan_result) as mock_scan,
329330
):
330331
result = await _cycode_scan_tool(ScanTypeOption.SECRET, paths=[tmpdir])
331332

@@ -352,7 +353,7 @@ async def test_cycode_scan_tool_summary_included_on_success() -> None:
352353

353354
with (
354355
tempfile.TemporaryDirectory() as tmpdir,
355-
patch('cycode.cli.apps.mcp.mcp_command._run_cycode_scan', return_value=scan_result),
356+
patch.object(mcp_module, '_run_cycode_scan', return_value=scan_result),
356357
):
357358
result = await _cycode_scan_tool(ScanTypeOption.SECRET, paths=[tmpdir])
358359

@@ -372,7 +373,7 @@ async def test_cycode_scan_tool_no_summary_on_error() -> None:
372373

373374
with (
374375
tempfile.TemporaryDirectory() as tmpdir,
375-
patch('cycode.cli.apps.mcp.mcp_command._run_cycode_scan', return_value=error_result),
376+
patch.object(mcp_module, '_run_cycode_scan', return_value=error_result),
376377
):
377378
result = await _cycode_scan_tool(ScanTypeOption.SECRET, paths=[tmpdir])
378379

0 commit comments

Comments
 (0)