This repository was archived by the owner on Apr 23, 2025. It is now read-only.
forked from raizamartin/gemini-code
-
Notifications
You must be signed in to change notification settings - Fork 0
Fix test coverage regression by updating import paths and test files #13
Merged
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ade5e27
Fix test coverage regression by using improved test files and fixing …
ipv1337 9266535
Improve system_tools test coverage and fix import paths in test files
ipv1337 9e67dd2
Merge branch 'main' into feature/fix-coverage-regression
ipv1337 41fd094
Remove temporary SonarCloud workarounds now that coverage is properly…
ipv1337 de2c837
Merge branch 'main' into feature/fix-coverage-regression
ipv1337 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,10 @@ | ||
| """ | ||
| Tests for system tools. | ||
| Tests for system_tools module to improve code coverage. | ||
| """ | ||
| import subprocess | ||
| import os | ||
| import pytest | ||
| from unittest.mock import patch, MagicMock | ||
| import subprocess | ||
|
|
||
| # Direct import for coverage tracking | ||
| import src.cli_code.tools.system_tools | ||
|
|
@@ -14,7 +15,7 @@ def test_bash_tool_init(): | |
| """Test BashTool initialization.""" | ||
| tool = BashTool() | ||
| assert tool.name == "bash" | ||
| assert tool.description == "Execute a bash command" | ||
| assert "Execute a bash command" in tool.description | ||
| assert isinstance(tool.BANNED_COMMANDS, list) | ||
| assert len(tool.BANNED_COMMANDS) > 0 | ||
|
|
||
|
|
@@ -79,7 +80,7 @@ def test_bash_tool_timeout(mock_popen): | |
|
|
||
| # Execute command with short timeout | ||
| tool = BashTool() | ||
| result = tool.execute("sleep 10", timeout=1000) # 1 second timeout | ||
| result = tool.execute("sleep 10", timeout=1) # 1 second timeout | ||
|
Comment on lines
81
to
+83
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| # Verify timeout handling | ||
| assert "Command timed out" in result | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
subprocessmodule is imported twice. Remove the redundant import.