()
| 601 | |
| 602 | #[test] |
| 603 | fn test_decorated_function() { |
| 604 | let mut parser = PythonParser::new(); |
| 605 | let source = r#" |
| 606 | @app.route("/api/users") |
| 607 | def get_users(): |
| 608 | pass |
| 609 | |
| 610 | @staticmethod |
| 611 | def helper(): |
| 612 | pass |
| 613 | "#; |
| 614 | let entities = parser.extract(source, "routes.py"); |
| 615 | assert!( |
| 616 | entities.iter().any(|e| e.name == "get_users"), |
| 617 | "Should find decorated function get_users" |
| 618 | ); |
| 619 | } |
| 620 | |
| 621 | #[test] |
| 622 | fn test_decorated_class() { |