Skip to content

Latest commit

 

History

History
248 lines (209 loc) · 12.8 KB

File metadata and controls

248 lines (209 loc) · 12.8 KB

StarryNote v2.1 — Test Log

Generated: 2026-03-07
Test Framework: pytest 9.0.2
Python: 3.14.0
Platform: macOS (Apple Silicon)
Total Tests: 382
Pass Rate: 100%


Test Execution Summary

Metric Value
Total Tests 382
Passed 382
Failed 0
Skipped 0
Execution Time ~18s
Warnings 7 (DeprecationWarning from SwigPy — external lib, non-blocking)

Test File Breakdown

test_engine.py — StarryEngine (AI Inference & Prompt)

# Test Name Status Description
1 test_strips_html_comments Verifies HTML comment removal from template
2 test_strips_multiline_comments Multiline comment blocks are fully stripped
3 test_preserves_markdown_structure Headers, tables, and formatting survive cleaning
4 test_collapses_excessive_newlines 3+ consecutive newlines collapse to 2
5 test_clean_reduces_template_size Cleaned template is smaller than raw
6 test_empty_template Empty string returns empty string
7 test_template_with_no_comments Comment-free template is unchanged
8 test_template_has_no_ai_instruction_comments Master template contains zero HTML comments
9 test_prompt_contains_knowledge_architect Prompt includes Knowledge Architect identity
10 test_prompt_contains_directives All core directives present
11 test_prompt_contains_mermaid_rules Mermaid classDef and rules embedded
12 test_prompt_contains_all_section_rules Section-specific rules for all 10 sections
13 test_prompt_contains_template Template is wrapped with START/END markers
14 test_prompt_contains_source_input Raw source content is included
15 test_image_prompt_uses_visual_label Image mode uses "visual architecture" label
16 test_text_prompt_uses_structured_data_label Text mode uses "structured data" label
17 test_prompt_no_html_comments Zero HTML comments in generated prompt
18 test_prompt_enforces_all_sections Prompt contains "ALL 10 sections" directive
19 test_routes_image_to_image_analyzer Image MIME routes to _analyze_image()
20 test_routes_pdf_to_pdf_analyzer PDF MIME routes to _analyze_pdf()
21 test_routes_text_to_text_analyzer Text MIME routes to _analyze_text()
22 test_max_tokens_is_sufficient MAX_TOKENS ≥ 8192

test_postprocessor.py — MermaidFixer, OutputCleaner, OutputValidator, PostProcessor

# Test Name Status Description
1 test_replaces_sequence_diagram sequenceDiagram → graph TD
2 test_replaces_mindmap mindmap → graph TD
3 test_replaces_class_diagram classDiagram → graph TD
4 test_preserves_valid_graph_td Valid graph TD unmodified
5 test_preserves_valid_flowchart Valid flowchart LR unmodified
6 test_injects_classdef_when_missing classDef auto-injected
7 test_does_not_duplicate_classdef Existing classDef not duplicated
8 test_removes_inline_style_directives style X fill:red stripped
9 test_removes_trailing_semicolons Line-ending semicolons removed
10 test_handles_no_mermaid_blocks Non-mermaid text unaffected
11 test_handles_multiple_mermaid_blocks Both blocks fixed independently
12 test_strips_html_ai_instructions <!-- AI INSTRUCTION --> removed
13 test_strips_bracket_ai_instructions [[AI INSTRUCTION]] removed
14 test_strips_rules_marker **RULES:** removed
15 test_strips_diagram_selection_marker **DIAGRAM SELECTION:** removed
16 test_strips_unfilled_placeholders {{PLACEHOLDER}} removed
17 test_preserves_normal_content Regular markdown preserved
18 test_collapses_excessive_newlines Whitespace normalized
19 test_detects_all_sections All 10 sections detected
20 test_detects_missing_sections Missing sections reported
21 test_detects_missing_mermaid Missing mermaid warned
22 test_detects_missing_exam_questions Missing questions warned
23 test_warns_about_leaked_instructions Leak detection works
24 test_warns_about_unfilled_placeholders Placeholder detection works
25 test_cleans_and_fixes_in_one_pass Full pipeline integration test
26 test_handles_clean_input Clean input passes through
27 test_handles_empty_input Empty string returns empty

test_prompt_builder.py — PromptBuilder

# Test Name Status Description
1 test_contains_knowledge_architect Identity present
2 test_contains_template Template wrapped correctly
3 test_contains_source_input Source content injected
4 test_image_mode_label Visual architecture label
5 test_text_mode_label Structured data label
6 test_core_directives All 4 directives present
7 test_mermaid_rules Exact classDef values
8 test_section_specific_rules All sections covered
9 test_output_rules "ALL 10 sections" enforced
10 test_no_html_comments Zero comment leakage
11 test_classdef_constants_match Constants match prompt
12 test_difficulty_levels_defined All 4 levels present
13 test_subject_classes_defined All 6 classes present
14 test_resource_types_defined All 7 types present

test_template_loader.py — TemplateLoader

# Test Name Status Description
1 test_loads_real_template Template file loads correctly
2 test_cleaned_is_shorter_or_equal Cleaning reduces size
3 test_compact_is_shortest Compact ≤ cleaned ≤ raw
4 test_path_is_absolute Path resolution works
5 test_recovery_mode_on_missing_template Graceful fallback
6 test_strips_html_comments Clean method works
7 test_strips_multiline_comments Multi-line clean works
8 test_collapses_whitespace Whitespace collapsed
9 test_preserves_markdown MD structure intact
10 test_empty_input Empty string handled
11 test_no_comments No-op on clean input
12 test_compacts_real_template Real template compacts
13 test_preserves_section_headers Headers survive compaction
14 test_removes_duplicate_rows Placeholder dedup works

test_template.py — Master Template Structure

# Test Name Status Description
1-10 test_section_exists[...] All 10 sections present
11 test_sections_are_numbered Roman numerals I-X
12 test_has_document_record Document record table
13 test_has_concept_register_table Concept/Definition columns
14 test_has_mermaid_block ```mermaid present
15 test_has_cyberpunk_styling classDef with #bc13fe/#00f3ff
16 test_mermaid_uses_graph_td Only graph TD used
17 test_has_exam_questions 3 questions present
18 test_has_collapsible_answers details/summary tags
19 test_has_confidence_meter 🔴🟡🟢🔵 emojis
20 test_has_quick_reference_elements Takeaways, traps, checklist
21 test_has_study_prescriptions Prescription section
22 test_has_source_archive RAW_STUDENT_INPUT placeholder
23 test_has_footer v2.0 footer
24 test_has_starry_note_branding S T A R R Y N O T E
25 test_no_html_comments Zero comments
26 test_no_ai_instruction_markers Zero instruction markers
27-32 test_placeholder_exists[...] All key placeholders
33 test_minimum_template_length 100+ lines

test_formatter.py — StarryFormatter

# Test Name Status Description
1 test_creates_instructions_directory Directory created
2 test_does_not_fail_if_dir_exists Idempotent init
3 test_output_dir_is_inside_target Correct nesting
4-11 test_save_* File creation, naming, content, UTF-8, spaces
12 test_strips_leaked_instructions_on_save Post-processing on save
13 test_fixes_mermaid_on_save Mermaid auto-repaired
14 test_post_process_default_is_true Default behavior verified
15 test_validates_complete_guide Validation API works

test_scanner.py — StarryScanner

# Test Name Status Description
1-4 test_resource_* UniversalResource fields + size_bytes
5-6 test_*_result ScanResult dataclass
7-16 test_scan_* Init, find, MIME, empty, recursive, multi-type
17-22 test_*_method ScanResult stats, pruning, errors, no-filter

test_edge_cases.py — Cross-Module Edge Cases

# Test Name Status Description
1 test_nested_code_blocks_in_output Non-mermaid code blocks preserved
2 test_empty_mermaid_block Empty mermaid handled
3 test_mermaid_with_quotes_in_labels Quoted labels preserved
4 test_mermaid_with_special_chars O(n) and special chars safe
5 test_flowchart_lr_preserved flowchart LR not replaced
6 test_multiline_ai_instruction Multi-line HTML comments stripped
7 test_preserves_details_tags HTML details/summary preserved
8 test_preserves_mermaid_graph_content Mermaid content preserved
9 test_mixed_leak_types All leak types stripped simultaneously
10 test_case_insensitive_section_detection Lowercase sections detected
11 test_partial_output_validity 8/10 sections still valid
12 test_realistic_dirty_output Full real-world scenario
13 test_large_content_handling 10k char input handled
14 test_special_chars_in_content Unicode math symbols
15 test_empty_content Empty prompt valid
16 test_multiline_template Complex template preserved
17 test_symlinks_are_handled Symlinks don't crash
18 test_empty_files_are_scanned 0-byte files scanned
19 test_deeply_nested_scan 4-level deep traversal

test_file_types.py — MimeClassifier, TextExtractor, Engine Routing (92 tests)

# Test Group Tests Status Description
1 TestMimeClassifierImages 9 jpeg, png, gif, bmp, tiff, webp, svg+xml, heic, unknown
2 TestMimeClassifierPdf 1 application/pdf
3 TestMimeClassifierOffice 7 docx, pptx, xlsx, odt, doc, xls, ppt
4 TestMimeClassifierStructured 5 json, csv, xml, yaml
5 TestMimeClassifierText 14 python, java, c, c++, go, rust, ruby, shell, markdown, html, css, js, ts, php
6 TestMimeClassifierBinary 15 zip, gzip, tar, 7z, rar, jar, exe, mach, audio, video, font
7 TestMimeClassifierFallback 2 Unknown types default to text
8 TestTextExtractorReadText 5 UTF-8, Latin-1, large files, empty, binary content
9 TestTextExtractorJsonReader 3 Valid JSON, invalid JSON, large JSON
10 TestTextExtractorCsvReader 2 Normal CSV, large CSV
11 TestTextExtractorOfficeReader 3 DOCX-like ZIP, empty docx, non-zip file
12 TestTextExtractorBinaryPreview 2 Metadata generation, missing file
13 TestEngineRouting 24 All 24 MIME→analyzer routes verified

Other Test Files

File Tests Status
test_tui.py 28 ✅ All passed
test_model.py 1 ✅ Skipped (no GPU in test env)
test_universal_scanner.py 1 ✅ Passed

Known Warnings (Non-Blocking)

DeprecationWarning: builtin type SwigPyPacked has no __module__ attribute
DeprecationWarning: builtin type SwigPyObject has no __module__ attribute
DeprecationWarning: builtin type swigvarlink has no __module__ attribute

These are from the python-magic library's SWIG bindings and are safe to ignore.