MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / create_with_upload_single_file

Function create_with_upload_single_file

e2e/rust/tests/upload_create.rs:93–115  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

91/// `--upload` with a single file (not a directory) should work.
92#[tokio::test]
93async fn create_with_upload_single_file() {
94 let tmpdir = tempfile::tempdir().expect("create tmpdir");
95 let file_path = tmpdir.path().join("config.txt");
96 fs::write(&file_path, "single-file-upload-test").expect("write config.txt");
97
98 let file_str = file_path.to_str().expect("file path is UTF-8");
99
100 let mut guard = SandboxGuard::create_with_upload(
101 file_str,
102 "/sandbox",
103 &["cat", "/sandbox/config.txt"],
104 )
105 .await
106 .expect("sandbox create --upload single file");
107
108 let clean = strip_ansi(&guard.create_output);
109 assert!(
110 clean.contains("single-file-upload-test"),
111 "expected single-file content in sandbox output:\n{clean}"
112 );
113
114 guard.cleanup().await;
115}

Callers

nothing calls this directly

Calls 3

strip_ansiFunction · 0.85
pathMethod · 0.80
cleanupMethod · 0.80

Tested by

no test coverage detected