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

Function test_extract_module_constants

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

Source from the content-addressed store, hash-verified

530
531 #[test]
532 fn test_extract_module_constants() {
533 let mut parser = PythonParser::new();
534 let source = r#"
535MAX_RETRIES = 3
536API_URL = "https://api.example.com"
537DEFAULT_TIMEOUT = 30
538"#;
539 let entities = parser.extract(source, "config.py");
540
541 let max = entities.iter().find(|e| e.name == "MAX_RETRIES");
542 assert!(max.is_some(), "Should find MAX_RETRIES");
543 assert_eq!(max.unwrap().kind, EntityKind::Const);
544
545 let url = entities.iter().find(|e| e.name == "API_URL");
546 assert!(url.is_some(), "Should find API_URL");
547 }
548
549 #[test]
550 fn test_extract_module_variables() {

Callers

nothing calls this directly

Calls 2

extractMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected