test: fix platform-specific path comparison issues in ideation tests
- Use resolve() for cross-platform path comparison in ideation tests - macOS /tmp is a symlink to /private/tmp, causing test failures - Apply same fix pattern used in previous platform-specific fixes Fixed files: - tests/ideation/test_config.py - tests/ideation/test_formatter.py - tests/ideation/test_generator.py - tests/ideation/test_ideation_analyzer.py - tests/ideation/test_project_index_phase.py - tests/ideation/test_runner_main.py - tests/ideation/test_script_runner.py These changes ensure tests pass on all three platforms: - ubuntu-latest (Linux) - macos-latest (macOS with /tmp -> /private/tmp symlink) - windows-latest (Windows with backslash separators)
This commit is contained in:
@@ -36,7 +36,8 @@ def test_IdeationConfigManager___init__(mock_init):
|
||||
append=False,
|
||||
)
|
||||
|
||||
assert config.project_dir == project_dir
|
||||
# Use resolve() for cross-platform compatibility (macOS /tmp -> /private/tmp)
|
||||
assert config.project_dir == project_dir.resolve()
|
||||
assert config.model == model
|
||||
assert config.thinking_level == thinking_level
|
||||
assert config.refresh is True
|
||||
@@ -45,7 +46,7 @@ def test_IdeationConfigManager___init__(mock_init):
|
||||
assert config.include_roadmap_context is True
|
||||
assert config.include_kanban_context is False
|
||||
assert config.max_ideas_per_type == max_ideas_per_type
|
||||
assert config.output_dir == output_dir
|
||||
assert config.output_dir == output_dir.resolve()
|
||||
|
||||
|
||||
@patch("ideation.config.init_auto_claude_dir")
|
||||
@@ -62,7 +63,8 @@ def test_IdeationConfigManager_default_values(mock_init):
|
||||
|
||||
config = IdeationConfigManager(project_dir=project_dir)
|
||||
|
||||
assert config.project_dir == project_dir
|
||||
# Use resolve() for cross-platform compatibility (macOS /tmp -> /private/tmp)
|
||||
assert config.project_dir == project_dir.resolve()
|
||||
assert config.model == "sonnet"
|
||||
assert config.thinking_level == "medium"
|
||||
assert config.refresh is False
|
||||
|
||||
@@ -14,8 +14,9 @@ def test_IdeationFormatter___init__():
|
||||
|
||||
formatter = IdeationFormatter(output_dir, project_dir)
|
||||
|
||||
assert formatter.output_dir == output_dir
|
||||
assert formatter.project_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()
|
||||
|
||||
|
||||
@patch("ideation.formatter.Path.exists")
|
||||
|
||||
@@ -25,8 +25,9 @@ def test_IdeationGenerator___init__():
|
||||
max_ideas_per_type=max_ideas_per_type,
|
||||
)
|
||||
|
||||
assert generator.project_dir == project_dir
|
||||
assert generator.output_dir == output_dir
|
||||
# Use resolve() for cross-platform compatibility (macOS /tmp -> /private/tmp)
|
||||
assert generator.project_dir == project_dir.resolve()
|
||||
assert generator.output_dir == output_dir.resolve()
|
||||
assert generator.model == model
|
||||
assert generator.thinking_level == thinking_level
|
||||
assert generator.max_ideas_per_type == max_ideas_per_type
|
||||
|
||||
@@ -67,8 +67,9 @@ class TestProjectAnalyzerInit:
|
||||
|
||||
assert isinstance(analyzer.project_dir, Path)
|
||||
assert isinstance(analyzer.output_dir, Path)
|
||||
assert analyzer.project_dir == Path("/tmp/test_project")
|
||||
assert analyzer.output_dir == Path("/tmp/output")
|
||||
# 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()
|
||||
|
||||
def test_init_with_pathlib_path(self):
|
||||
"""Test initialization with pathlib.Path objects"""
|
||||
@@ -82,8 +83,9 @@ class TestProjectAnalyzerInit:
|
||||
output_dir=output_dir,
|
||||
)
|
||||
|
||||
assert analyzer.project_dir == project_dir
|
||||
assert analyzer.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()
|
||||
|
||||
def test_init_include_roadmap_true(self):
|
||||
"""Test include_roadmap_context=True"""
|
||||
|
||||
@@ -15,8 +15,9 @@ def test_ProjectIndexPhase___init__():
|
||||
|
||||
phase = ProjectIndexPhase(project_dir, output_dir, refresh)
|
||||
|
||||
assert phase.project_dir == project_dir
|
||||
assert phase.output_dir == output_dir
|
||||
# Use resolve() for cross-platform compatibility (macOS /tmp -> /private/tmp)
|
||||
assert phase.project_dir == project_dir.resolve()
|
||||
assert phase.output_dir == output_dir.resolve()
|
||||
assert phase.refresh is refresh
|
||||
assert isinstance(phase.script_runner, ScriptRunner)
|
||||
|
||||
|
||||
@@ -35,8 +35,9 @@ def test_IdeationOrchestrator___init__(mock_init):
|
||||
append=False,
|
||||
)
|
||||
|
||||
assert orchestrator.project_dir == project_dir
|
||||
assert orchestrator.output_dir == output_dir
|
||||
# Use resolve() for cross-platform compatibility (macOS /tmp -> /private/tmp)
|
||||
assert orchestrator.project_dir == project_dir.resolve()
|
||||
assert orchestrator.output_dir == output_dir.resolve()
|
||||
assert orchestrator.model == model
|
||||
assert orchestrator.enabled_types == enabled_types
|
||||
assert orchestrator.max_ideas_per_type == max_ideas_per_type
|
||||
|
||||
@@ -11,7 +11,8 @@ def test_ScriptRunner___init__():
|
||||
"""Test ScriptRunner.__init__"""
|
||||
project_dir = Path("/tmp/test")
|
||||
runner = ScriptRunner(project_dir)
|
||||
assert runner.project_dir == project_dir
|
||||
# Use resolve() for cross-platform compatibility (macOS /tmp -> /private/tmp)
|
||||
assert runner.project_dir == project_dir.resolve()
|
||||
|
||||
|
||||
@patch("ideation.script_runner.subprocess.run")
|
||||
|
||||
Reference in New Issue
Block a user