Files
wtismycode/wtismycode-core/tests/renderer_tests.rs
Arkasha b3eb591809 feat: smart integration detection with package classifier
- Add PackageClassifier with built-in dictionary (~200 popular packages)
- Hardcode Python 3.10+ stdlib list to filter out standard library imports
- Add PyPI API lookup for unknown packages (online mode, 3s timeout)
- Cache PyPI results in .wtismycode/cache/pypi.json
- Add --offline flag to skip PyPI lookups
- Classify packages into: HTTP, Database, Queue, Storage, AI/ML, Auth, Testing, Logging, Internal, Third-party
- User config integration_patterns override auto-detection
- Update renderer to show integrations grouped by category
- Update ARCHITECTURE.md template with new integration format
2026-02-15 12:45:56 +03:00

37 lines
1.1 KiB
Rust

//! Tests for the renderer functionality
use wtismycode_core::{
model::ProjectModel,
renderer::Renderer,
};
#[test]
fn test_render_with_integrations() {
let mut project_model = ProjectModel::new();
// Add classified integrations (new format)
project_model.classified_integrations.insert(
"Database".to_string(),
vec!["sqlalchemy".to_string(), "asyncpg".to_string()],
);
project_model.classified_integrations.insert(
"HTTP".to_string(),
vec!["fastapi".to_string(), "requests".to_string()],
);
let renderer = Renderer::new();
let result = renderer.render_architecture_md(&project_model, None);
assert!(result.is_ok());
let rendered = result.unwrap();
println!("Rendered:\n{}", rendered);
assert!(rendered.contains("## Integrations"));
assert!(rendered.contains("### Database"));
assert!(rendered.contains("- sqlalchemy"));
assert!(rendered.contains("- asyncpg"));
assert!(rendered.contains("### HTTP"));
assert!(rendered.contains("- fastapi"));
assert!(rendered.contains("- requests"));
}