Download codex-rs/connectors/src/plugin_config_tests.rs from SaylorTwift/codex: direct link, hf CLI and curl.
- Browser
- Download file 1.52 kB
-
https://huggingface.co/SaylorTwift/codex/resolve/main/codex-rs/connectors/src/plugin_config_tests.rs
- Command line
-
hf download hf://SaylorTwift/codex/codex-rs/connectors/src/plugin_config_tests.rs
-
curl -L -o plugin_config_tests.rs https://huggingface.co/SaylorTwift/codex/resolve/main/codex-rs/connectors/src/plugin_config_tests.rs
1.52 kB
| use codex_plugin::AppConnectorId; | |
| use codex_plugin::AppDeclaration; | |
| use pretty_assertions::assert_eq; | |
| use super::parse_plugin_app_config; | |
| fn parses_plugin_app_config_in_order_without_validating_connector_ids() { | |
| let parsed = parse_plugin_app_config( | |
| r#"{ | |
| "apps": { | |
| "calendar": { | |
| "id": "connector_calendar", | |
| "category": " productivity " | |
| }, | |
| "drive": { | |
| "id": "connector_calendar", | |
| "category": " " | |
| }, | |
| "blank": { | |
| "id": " " | |
| } | |
| } | |
| }"#, | |
| ) | |
| .expect("plugin app config should parse"); | |
| assert_eq!( | |
| parsed, | |
| vec![ | |
| AppDeclaration { | |
| name: "calendar".to_string(), | |
| connector_id: AppConnectorId("connector_calendar".to_string()), | |
| category: Some("productivity".to_string()), | |
| }, | |
| AppDeclaration { | |
| name: "drive".to_string(), | |
| connector_id: AppConnectorId("connector_calendar".to_string()), | |
| category: None, | |
| }, | |
| AppDeclaration { | |
| name: "blank".to_string(), | |
| connector_id: AppConnectorId(" ".to_string()), | |
| category: None, | |
| }, | |
| ] | |
| ); | |
| } | |
| fn rejects_invalid_plugin_app_config() { | |
| assert!(parse_plugin_app_config("not json").is_err()); | |
| } | |