Skip to content

Commit 0da4759

Browse files
JuanCS-Devclaude
andcommitted
fix(tests): update test imports for renamed ExecutionResult types
Fixed broken imports after ExecutionResult consolidation: - streaming/__init__.py: export StreamingExecutionResult - integration/__init__.py: export ToolExecutionResult - Updated 6 test files to use correct type names: - SafeExecutionResult (from safe_executor) - StreamingExecutionResult (from streaming) - ToolExecutionResult (from integration) All 5791 tests now collect without errors. 106 critical tests passing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 8f9895f commit 0da4759

File tree

9 files changed

+181
-166
lines changed

9 files changed

+181
-166
lines changed

.qwen/index/index.json

Lines changed: 163 additions & 148 deletions
Large diffs are not rendered by default.

jdev_cli/integration/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,20 @@
1515

1616
from .safety import SafetyValidator, safety_validator
1717
from .session import Session, SessionManager, session_manager
18-
from .shell_bridge import ShellBridge, ExecutionResult, shell_bridge
18+
from .shell_bridge import ShellBridge, ToolExecutionResult, shell_bridge
1919

2020
__all__ = [
2121
# Safety
2222
"SafetyValidator",
2323
"safety_validator",
24-
24+
2525
# Session
2626
"Session",
2727
"SessionManager",
2828
"session_manager",
29-
29+
3030
# Shell Bridge
3131
"ShellBridge",
32-
"ExecutionResult",
32+
"ToolExecutionResult",
3333
"shell_bridge",
3434
]

jdev_cli/streaming/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Reactive TUI and async streaming components."""
22

3-
from .executor import AsyncCommandExecutor, ExecutionResult
3+
from .executor import AsyncCommandExecutor, StreamingExecutionResult
44
from .renderer import (
55
ReactiveRenderer,
66
ConcurrentRenderer,
@@ -16,7 +16,7 @@
1616

1717
__all__ = [
1818
'AsyncCommandExecutor',
19-
'ExecutionResult',
19+
'StreamingExecutionResult',
2020
'ReactiveRenderer',
2121
'ConcurrentRenderer',
2222
'RenderEvent',

tests/security/test_safe_executor_real.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Tests real behavior, not imaginary features.
66
77
Implementation details (READ FROM FILE):
8-
- execute() is async, returns ExecutionResult
8+
- execute() is async, returns SafeExecutionResult
99
- is_command_allowed() returns Tuple[bool, str]
1010
- Whitelist: pytest, ruff, git, ls, du, pwd, whoami, etc
1111
- Dangerous patterns: rm, sudo, pipes |, &&, ||, ;, $(), backticks
@@ -18,7 +18,7 @@
1818
from pathlib import Path
1919
from jdev_tui.core.safe_executor import (
2020
SafeCommandExecutor,
21-
ExecutionResult,
21+
SafeExecutionResult,
2222
AllowedCommand,
2323
CommandCategory,
2424
get_safe_executor,

tests/test_phase2_integration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
SafetyValidator,
1717
SessionManager,
1818
ShellBridge,
19-
ExecutionResult,
19+
ToolExecutionResult,
2020
)
2121
from jdev_cli.core.parser import ResponseParser
2222

tests/test_streaming.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import asyncio
55
from jdev_cli.streaming import (
66
AsyncCommandExecutor,
7-
ExecutionResult,
7+
StreamingExecutionResult,
88
ReactiveRenderer,
99
RenderEvent,
1010
RenderEventType,

tests/unit/core/test_safe_executor.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
from jdev_tui.core.safe_executor import (
1818
SafeCommandExecutor,
19-
ExecutionResult,
19+
SafeExecutionResult,
2020
AllowedCommand,
2121
CommandCategory,
2222
get_safe_executor,
@@ -266,12 +266,12 @@ def test_get_allowed_commands_by_category_returns_dict(
266266
assert expected_categories.issubset(set(by_category.keys()))
267267

268268

269-
class TestExecutionResultDataclass:
270-
"""Tests for ExecutionResult dataclass."""
269+
class TestSafeExecutionResultDataclass:
270+
"""Tests for SafeExecutionResult dataclass."""
271271

272272
def test_success_result_creation(self) -> None:
273273
"""Test creating a successful result."""
274-
result = ExecutionResult(
274+
result = SafeExecutionResult(
275275
success=True,
276276
exit_code=0,
277277
stdout="output",
@@ -286,7 +286,7 @@ def test_success_result_creation(self) -> None:
286286

287287
def test_failure_result_creation(self) -> None:
288288
"""Test creating a failure result."""
289-
result = ExecutionResult(
289+
result = SafeExecutionResult(
290290
success=False,
291291
exit_code=1,
292292
stdout="",

tests/unit/core/test_safe_executor_coverage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
from jdev_tui.core.safe_executor import (
3333
SafeCommandExecutor,
34-
ExecutionResult,
34+
SafeExecutionResult,
3535
AllowedCommand,
3636
CommandCategory,
3737
get_safe_executor,

tests/unit/core/test_safe_executor_hypothesis.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from jdev_tui.core.safe_executor import (
1717
SafeCommandExecutor,
1818
AllowedCommand,
19-
ExecutionResult,
19+
SafeExecutionResult,
2020
CommandCategory,
2121
)
2222

@@ -337,7 +337,7 @@ class TestExecutionResultProperties:
337337
@settings(max_examples=50)
338338
def test_execution_result_creation(self, success, exit_code, stdout, stderr, command):
339339
"""Property: ExecutionResult handles various inputs."""
340-
result = ExecutionResult(
340+
result = SafeExecutionResult(
341341
success=success,
342342
exit_code=exit_code,
343343
stdout=stdout,

0 commit comments

Comments
 (0)