MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / open

Function open

atomic-cli/tests/it/remote_sandbox_client_test.rs:346–371  ·  view source on GitHub ↗
(env: &Env, host: &Path, view: &str, dest: &Path)

Source from the content-addressed store, hash-verified

344}
345
346fn open(env: &Env, host: &Path, view: &str, dest: &Path) -> Value {
347 let out = ok(
348 env.run(
349 host,
350 &[
351 "sandbox",
352 "open",
353 view,
354 "--acting-as",
355 "did:key:zAgent",
356 "--dest",
357 dest.to_str().unwrap(),
358 ],
359 ),
360 "sandbox open",
361 );
362 assert!(out.contains("opened"), "{out}");
363 let pointer = dest.join(".atomic-sandbox");
364 #[cfg(unix)]
365 {
366 use std::os::unix::fs::PermissionsExt;
367 let mode = std::fs::metadata(&pointer).unwrap().permissions().mode();
368 assert_eq!(mode & 0o077, 0, "the pointer holds a token: owner-only");
369 }
370 serde_json::from_slice(&std::fs::read(pointer).unwrap()).unwrap()
371}
372
373// ── the tests ───────────────────────────────────────────────────────────
374

Calls 7

okFunction · 0.70
readFunction · 0.70
metadataFunction · 0.50
runMethod · 0.45
unwrapMethod · 0.45
modeMethod · 0.45
permissionsMethod · 0.45

Tested by

no test coverage detected