()
| 2716 | |
| 2717 | #[test] |
| 2718 | fn expand_full_preset() { |
| 2719 | let mut data = serde_json::json!({ |
| 2720 | "network_policies": { |
| 2721 | "test": { |
| 2722 | "endpoints": [{ |
| 2723 | "host": "api.example.com", |
| 2724 | "port": 80, |
| 2725 | "protocol": "rest", |
| 2726 | "access": "full" |
| 2727 | }], |
| 2728 | "binaries": [] |
| 2729 | } |
| 2730 | } |
| 2731 | }); |
| 2732 | expand_access_presets(&mut data); |
| 2733 | let rules = data["network_policies"]["test"]["endpoints"][0]["rules"] |
| 2734 | .as_array() |
| 2735 | .unwrap(); |
| 2736 | assert_eq!(rules.len(), 1); |
| 2737 | assert_eq!(rules[0]["allow"]["method"].as_str().unwrap(), "*"); |
| 2738 | assert_eq!(rules[0]["allow"]["path"].as_str().unwrap(), "**"); |
| 2739 | } |
| 2740 | |
| 2741 | #[test] |
| 2742 | fn expand_graphql_readonly_preset() { |
nothing calls this directly
no test coverage detected