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

Function open

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

Source from the content-addressed store, hash-verified

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

Callers 15

runMethod · 0.85
runMethod · 0.85
open_repositoryFunction · 0.85
open_gitFunction · 0.85
runMethod · 0.85
test_add_run_dry_runFunction · 0.85
statusFunction · 0.85
logFunction · 0.85

Calls 6

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

Tested by

no test coverage detected