| 530 | |
| 531 | #[test] |
| 532 | fn test_extract_module_constants() { |
| 533 | let mut parser = PythonParser::new(); |
| 534 | let source = r#" |
| 535 | MAX_RETRIES = 3 |
| 536 | API_URL = "https://api.example.com" |
| 537 | DEFAULT_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() { |