| 553 | |
| 554 | #[test] |
| 555 | fn test_extract_module_constants() { |
| 556 | let mut parser = PythonParser::new(); |
| 557 | let source = r#" |
| 558 | MAX_RETRIES = 3 |
| 559 | API_URL = "https://api.example.com" |
| 560 | DEFAULT_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() { |