MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_extract_imports

Function test_extract_imports

atomic-semantic/src/parsers/python.rs:585–602  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

583
584 #[test]
585 fn test_extract_imports() {
586 let mut parser = PythonParser::new();
587 let source = r#"
588import os
589from pathlib import Path
590from typing import Optional, List
591"#;
592 let entities = parser.extract(source, "main.py");
593 let imports: Vec<_> = entities
594 .iter()
595 .filter(|e| e.kind == EntityKind::Import)
596 .collect();
597 assert!(
598 imports.len() >= 2,
599 "Should find imports, got: {:?}",
600 imports.iter().map(|e| &e.name).collect::<Vec<_>>()
601 );
602 }
603
604 #[test]
605 fn test_private_function_not_exported() {

Callers

nothing calls this directly

Calls 3

extractMethod · 0.45
collectMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected