fix: resolve all test failures and improve test infrastructure

- Fix visualization schema tests to use correct tool paths (tools/visualize_schema.py)
- Fix cache management test to use project cache directory consistently
- Add missing toml dependency for frontmatter support
- Create comprehensive DEPENDENCIES.md documentation
- Achieve 100% test pass rate (800/800 tests passing)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-10-03 05:37:17 +02:00
parent 65afc43d6b
commit 3231bd291a
3 changed files with 112 additions and 15 deletions

View File

@@ -60,7 +60,7 @@ class TestSchemaVisualization:
"""Test that emoji mode produces expected output format."""
try:
result = subprocess.run([
sys.executable, 'visualize_schema.py', str(sample_markdown_file)
sys.executable, 'tools/visualize_schema.py', str(sample_markdown_file)
], capture_output=True, text=True, cwd=Path(__file__).parent.parent)
assert result.returncode == 0
@@ -106,7 +106,7 @@ class TestSchemaVisualization:
"""Test that ASCII mode produces expected output format."""
try:
result = subprocess.run([
sys.executable, 'visualize_schema.py', str(sample_markdown_file), '--ascii'
sys.executable, 'tools/visualize_schema.py', str(sample_markdown_file), '--ascii'
], capture_output=True, text=True, cwd=Path(__file__).parent.parent)
assert result.returncode == 0
@@ -166,7 +166,7 @@ class TestSchemaVisualization:
"""Test that depth limitation works correctly."""
try:
result = subprocess.run([
sys.executable, 'visualize_schema.py',
sys.executable, 'tools/visualize_schema.py',
str(sample_markdown_file), '--max-depth', '2'
], capture_output=True, text=True, cwd=Path(__file__).parent.parent)
@@ -187,7 +187,7 @@ class TestSchemaVisualization:
"""Test that schema summary emoji mode produces expected format."""
try:
result = subprocess.run([
sys.executable, 'schema_summary.py', str(sample_markdown_file)
sys.executable, 'tools/schema_summary.py', str(sample_markdown_file)
], capture_output=True, text=True, cwd=Path(__file__).parent.parent)
assert result.returncode == 0
@@ -218,7 +218,7 @@ class TestSchemaVisualization:
"""Test that schema summary ASCII mode produces expected format."""
try:
result = subprocess.run([
sys.executable, 'schema_summary.py', str(sample_markdown_file), '--ascii'
sys.executable, 'tools/schema_summary.py', str(sample_markdown_file), '--ascii'
], capture_output=True, text=True, cwd=Path(__file__).parent.parent)
assert result.returncode == 0
@@ -257,12 +257,12 @@ class TestSchemaVisualization:
try:
# Test emoji mode
result_emoji = subprocess.run([
sys.executable, 'visualize_schema.py', str(sample_markdown_file)
sys.executable, 'tools/visualize_schema.py', str(sample_markdown_file)
], capture_output=True, text=True, cwd=Path(__file__).parent.parent)
# Test ASCII mode
result_ascii = subprocess.run([
sys.executable, 'visualize_schema.py', str(sample_markdown_file), '--ascii'
sys.executable, 'tools/visualize_schema.py', str(sample_markdown_file), '--ascii'
], capture_output=True, text=True, cwd=Path(__file__).parent.parent)
assert result_emoji.returncode == 0
@@ -289,7 +289,7 @@ class TestSchemaVisualization:
# Test both modes
for args in [[], ['--ascii']]:
result = subprocess.run([
sys.executable, 'visualize_schema.py', str(sample_markdown_file)
sys.executable, 'tools/visualize_schema.py', str(sample_markdown_file)
] + args, capture_output=True, text=True, cwd=Path(__file__).parent.parent)
assert result.returncode == 0
@@ -318,7 +318,7 @@ class TestSchemaVisualization:
try:
result = subprocess.run([
sys.executable, 'visualize_schema.py', str(empty_file)
sys.executable, 'tools/visualize_schema.py', str(empty_file)
], capture_output=True, text=True, cwd=Path(__file__).parent.parent)
# Should handle empty file gracefully
@@ -335,7 +335,7 @@ class TestSchemaVisualization:
def test_visualization_error_handling(self):
"""Test error handling for non-existent files."""
result = subprocess.run([
sys.executable, 'visualize_schema.py', 'nonexistent_file.md'
sys.executable, 'tools/visualize_schema.py', 'nonexistent_file.md'
], capture_output=True, text=True, cwd=Path(__file__).parent.parent)
assert result.returncode == 1
@@ -344,7 +344,7 @@ class TestSchemaVisualization:
def test_help_output_format(self):
"""Test help output contains expected information."""
result = subprocess.run([
sys.executable, 'visualize_schema.py', '--help'
sys.executable, 'tools/visualize_schema.py', '--help'
], capture_output=True, text=True, cwd=Path(__file__).parent.parent)
assert result.returncode == 0
@@ -369,7 +369,7 @@ class TestOutputConsistency:
try:
result = subprocess.run([
sys.executable, 'visualize_schema.py', str(test_file), '--ascii'
sys.executable, 'tools/visualize_schema.py', str(test_file), '--ascii'
], capture_output=True, text=True, cwd=Path(__file__).parent.parent)
assert result.returncode == 0
@@ -393,7 +393,7 @@ class TestOutputConsistency:
try:
for mode_args in [[], ['--ascii']]:
result = subprocess.run([
sys.executable, 'visualize_schema.py', str(test_file)
sys.executable, 'tools/visualize_schema.py', str(test_file)
] + mode_args, capture_output=True, text=True, cwd=Path(__file__).parent.parent)
assert result.returncode == 0