Download codex-rs/exec-server/src/local_file_system_path_uri_tests.rs from SaylorTwift/codex: direct link, hf CLI and curl.
- Browser
- Download file 729 Bytes
-
https://huggingface.co/SaylorTwift/codex/resolve/main/codex-rs/exec-server/src/local_file_system_path_uri_tests.rs
- Command line
-
hf download hf://SaylorTwift/codex/codex-rs/exec-server/src/local_file_system_path_uri_tests.rs
-
curl -L -o local_file_system_path_uri_tests.rs https://huggingface.co/SaylorTwift/codex/resolve/main/codex-rs/exec-server/src/local_file_system_path_uri_tests.rs
729 Bytes
| use codex_utils_path_uri::PathUri; | |
| use pretty_assertions::assert_eq; | |
| use tokio::io; | |
| use super::*; | |
| async fn direct_file_system_rejects_non_native_uri_as_invalid_input() { | |
| let error = DirectFileSystem | |
| .read_file(&non_native_uri(), Default::default(), /*sandbox*/ None) | |
| .await | |
| .expect_err("non-native URI should be rejected"); | |
| assert_eq!(error.kind(), io::ErrorKind::InvalidInput); | |
| } | |
| fn non_native_uri() -> PathUri { | |
| let uri = "file://server/share/file.txt"; | |
| let uri = "file:///usr/local/file.txt"; | |
| match PathUri::parse(uri) { | |
| Ok(uri) => uri, | |
| Err(err) => panic!("valid non-native URI should parse: {err}"), | |
| } | |
| } | |