Initial project scaffold - Phase 1 MVP structure
Core modules: - cli.py: Command-line interface with Click - pipeline.py: Main orchestrator - video_processor.py: Frame extraction with ffmpeg - audio_analyzer.py: Whisper transcription - vision_analyzer.py: Component detection (placeholder) - doc_generator.py: Markdown + PDF output Also includes: - pyproject.toml with uv/hatch config - Prompts for AI analysis - Basic tests - ROADMAP.md with 4-week plan
This commit is contained in:
1
tests/__init__.py
Normal file
1
tests/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
# CAD-Documenter tests
|
||||
54
tests/test_pipeline.py
Normal file
54
tests/test_pipeline.py
Normal file
@@ -0,0 +1,54 @@
|
||||
"""Basic tests for CAD-Documenter pipeline."""
|
||||
|
||||
import pytest
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def test_imports():
|
||||
"""Test that all modules can be imported."""
|
||||
from cad_documenter import __version__
|
||||
from cad_documenter.cli import main
|
||||
from cad_documenter.pipeline import DocumentationPipeline
|
||||
from cad_documenter.video_processor import VideoProcessor
|
||||
from cad_documenter.audio_analyzer import AudioAnalyzer
|
||||
from cad_documenter.vision_analyzer import VisionAnalyzer
|
||||
from cad_documenter.doc_generator import DocGenerator
|
||||
|
||||
assert __version__ == "0.1.0"
|
||||
|
||||
|
||||
def test_transcript_dataclass():
|
||||
"""Test Transcript dataclass functionality."""
|
||||
from cad_documenter.audio_analyzer import Transcript, TranscriptSegment
|
||||
|
||||
segments = [
|
||||
TranscriptSegment(start=0.0, end=5.0, text="This is the main bracket"),
|
||||
TranscriptSegment(start=5.0, end=10.0, text="It holds the motor"),
|
||||
TranscriptSegment(start=10.0, end=15.0, text="Made of aluminum"),
|
||||
]
|
||||
|
||||
transcript = Transcript(segments=segments, full_text="This is the main bracket. It holds the motor. Made of aluminum.")
|
||||
|
||||
# Test get_text_at
|
||||
text = transcript.get_text_at(7.0, window=3.0)
|
||||
assert "holds the motor" in text
|
||||
assert "main bracket" in text
|
||||
|
||||
|
||||
def test_component_dataclass():
|
||||
"""Test Component dataclass."""
|
||||
from cad_documenter.vision_analyzer import Component
|
||||
|
||||
component = Component(
|
||||
name="Main Bracket",
|
||||
description="Primary structural member",
|
||||
function="Holds the motor",
|
||||
material="Aluminum 6061-T6",
|
||||
features=["4x M6 holes", "Fillet radii"],
|
||||
)
|
||||
|
||||
assert component.name == "Main Bracket"
|
||||
assert len(component.features) == 2
|
||||
|
||||
|
||||
# TODO: Add integration tests with sample videos
|
||||
Reference in New Issue
Block a user