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

Function write_test_file

crates/openshell-server/src/tls_test_utils.rs:21–26  ·  view source on GitHub ↗

Write bytes to a file inside `dir`, panicking on failure.

(dir: &Path, name: &str, data: &[u8])

Source from the content-addressed store, hash-verified

19
20/// Write bytes to a file inside `dir`, panicking on failure.
21pub fn write_test_file(dir: &Path, name: &str, data: &[u8]) {
22 let path = dir.join(name);
23 File::create(&path)
24 .and_then(|mut file| file.write_all(data))
25 .expect("failed to write test file");
26}
27
28/// Generate a self-signed CA certificate and a `localhost` server certificate,
29/// writing them as PEM files into `dir`.

Callers 2

generate_server_certFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected