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

Function test_extract_imports

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

Source from the content-addressed store, hash-verified

560
561 #[test]
562 fn test_extract_imports() {
563 let mut parser = PythonParser::new();
564 let source = r#"
565import os
566from pathlib import Path
567from typing import Optional, List
568"#;
569 let entities = parser.extract(source, "main.py");
570 let imports: Vec<_> = entities
571 .iter()
572 .filter(|e| e.kind == EntityKind::Import)
573 .collect();
574 assert!(
575 imports.len() >= 2,
576 "Should find imports, got: {:?}",
577 imports.iter().map(|e| &e.name).collect::<Vec<_>>()
578 );
579 }
580
581 #[test]
582 fn test_private_function_not_exported() {

Callers

nothing calls this directly

Calls 2

extractMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected