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

Function test_extract_module_constants

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

Source from the content-addressed store, hash-verified

553
554 #[test]
555 fn test_extract_module_constants() {
556 let mut parser = PythonParser::new();
557 let source = r#"
558MAX_RETRIES = 3
559API_URL = "https://api.example.com"
560DEFAULT_TIMEOUT = 30
561"#;
562 let entities = parser.extract(source, "config.py");
563
564 let max = entities.iter().find(|e| e.name == "MAX_RETRIES");
565 assert!(max.is_some(), "Should find MAX_RETRIES");
566 assert_eq!(max.unwrap().kind, EntityKind::Const);
567
568 let url = entities.iter().find(|e| e.name == "API_URL");
569 assert!(url.is_some(), "Should find API_URL");
570 }
571
572 #[test]
573 fn test_extract_module_variables() {

Callers

nothing calls this directly

Calls 2

extractMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected