test: fix all ideation test path comparison issues
Replace .resolve() path comparisons with string comparisons across all ideation test files. On Windows, /tmp/test resolves to D:/tmp/test, and on macOS /tmp/test resolves to /private/tmp/test, but the implementations store paths as-is without resolving. Fixed files: - test_formatter.py - test_generator.py - test_ideation_analyzer.py - test_script_runner.py - test_runner_main.py - test_project_index_phase.py
This commit is contained in:
@@ -14,9 +14,9 @@ def test_IdeationFormatter___init__():
|
||||
|
||||
formatter = IdeationFormatter(output_dir, project_dir)
|
||||
|
||||
# Use resolve() for cross-platform compatibility (macOS /tmp -> /private/tmp)
|
||||
assert formatter.output_dir == output_dir.resolve()
|
||||
assert formatter.project_dir == project_dir.resolve()
|
||||
# Compare paths without resolve() since the implementation stores paths as-is
|
||||
assert str(formatter.output_dir) == str(output_dir)
|
||||
assert str(formatter.project_dir) == str(project_dir)
|
||||
|
||||
|
||||
@patch("ideation.formatter.Path.exists")
|
||||
|
||||
@@ -25,9 +25,9 @@ def test_IdeationGenerator___init__():
|
||||
max_ideas_per_type=max_ideas_per_type,
|
||||
)
|
||||
|
||||
# Use resolve() for cross-platform compatibility (macOS /tmp -> /private/tmp)
|
||||
assert generator.project_dir == project_dir.resolve()
|
||||
assert generator.output_dir == output_dir.resolve()
|
||||
# Compare paths without resolve() since the implementation stores paths as-is
|
||||
assert str(generator.project_dir) == str(project_dir)
|
||||
assert str(generator.output_dir) == str(output_dir)
|
||||
assert generator.model == model
|
||||
assert generator.thinking_level == thinking_level
|
||||
assert generator.max_ideas_per_type == max_ideas_per_type
|
||||
|
||||
@@ -67,9 +67,9 @@ class TestProjectAnalyzerInit:
|
||||
|
||||
assert isinstance(analyzer.project_dir, Path)
|
||||
assert isinstance(analyzer.output_dir, Path)
|
||||
# Use resolve() for cross-platform compatibility (macOS /tmp -> /private/tmp)
|
||||
assert analyzer.project_dir == Path("/tmp/test_project").resolve()
|
||||
assert analyzer.output_dir == Path("/tmp/output").resolve()
|
||||
# Compare paths without resolve() since the implementation stores paths as-is
|
||||
assert str(analyzer.project_dir) == "/tmp/test_project"
|
||||
assert str(analyzer.output_dir) == "/tmp/output"
|
||||
|
||||
def test_init_with_pathlib_path(self):
|
||||
"""Test initialization with pathlib.Path objects"""
|
||||
@@ -83,9 +83,9 @@ class TestProjectAnalyzerInit:
|
||||
output_dir=output_dir,
|
||||
)
|
||||
|
||||
# Use resolve() for cross-platform compatibility (macOS /tmp -> /private/tmp)
|
||||
assert analyzer.project_dir == project_dir.resolve()
|
||||
assert analyzer.output_dir == output_dir.resolve()
|
||||
# Compare paths without resolve() since the implementation stores paths as-is
|
||||
assert str(analyzer.project_dir) == str(project_dir)
|
||||
assert str(analyzer.output_dir) == str(output_dir)
|
||||
|
||||
def test_init_include_roadmap_true(self):
|
||||
"""Test include_roadmap_context=True"""
|
||||
|
||||
@@ -15,9 +15,9 @@ def test_ProjectIndexPhase___init__():
|
||||
|
||||
phase = ProjectIndexPhase(project_dir, output_dir, refresh)
|
||||
|
||||
# Use resolve() for cross-platform compatibility (macOS /tmp -> /private/tmp)
|
||||
assert phase.project_dir == project_dir.resolve()
|
||||
assert phase.output_dir == output_dir.resolve()
|
||||
# Compare paths without resolve() since the implementation stores paths as-is
|
||||
assert str(phase.project_dir) == str(project_dir)
|
||||
assert str(phase.output_dir) == str(output_dir)
|
||||
assert phase.refresh is refresh
|
||||
assert isinstance(phase.script_runner, ScriptRunner)
|
||||
|
||||
|
||||
@@ -35,9 +35,9 @@ def test_IdeationOrchestrator___init__(mock_init):
|
||||
append=False,
|
||||
)
|
||||
|
||||
# Use resolve() for cross-platform compatibility (macOS /tmp -> /private/tmp)
|
||||
assert orchestrator.project_dir == project_dir.resolve()
|
||||
assert orchestrator.output_dir == output_dir.resolve()
|
||||
# Compare paths without resolve() since the implementation stores paths as-is
|
||||
assert str(orchestrator.project_dir) == str(project_dir)
|
||||
assert str(orchestrator.output_dir) == str(output_dir)
|
||||
assert orchestrator.model == model
|
||||
assert orchestrator.enabled_types == enabled_types
|
||||
assert orchestrator.max_ideas_per_type == max_ideas_per_type
|
||||
|
||||
@@ -11,8 +11,8 @@ def test_ScriptRunner___init__():
|
||||
"""Test ScriptRunner.__init__"""
|
||||
project_dir = Path("/tmp/test")
|
||||
runner = ScriptRunner(project_dir)
|
||||
# Use resolve() for cross-platform compatibility (macOS /tmp -> /private/tmp)
|
||||
assert runner.project_dir == project_dir.resolve()
|
||||
# Compare paths without resolve() since the implementation stores paths as-is
|
||||
assert str(runner.project_dir) == str(project_dir)
|
||||
|
||||
|
||||
@patch("ideation.script_runner.subprocess.run")
|
||||
|
||||
Reference in New Issue
Block a user