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

Function setup

atomic-cli/tests/it/remote_sandbox_client_test.rs:317–344  ·  view source on GitHub ↗

A host repository with two recorded files on `dev` and a draft `exp-1` off it, set up before the server starts; then the server, and the host side of the environment talking through it.

()

Source from the content-addressed store, hash-verified

315/// off it, set up before the server starts; then the server, and the host
316/// side of the environment talking through it.
317fn setup() -> (Server, Env, TempDir) {
318 let local = Env {
319 home: TempDir::new().unwrap(),
320 socket: None,
321 };
322 let host = TempDir::new().unwrap();
323 ok(local.run(host.path(), &["init"]), "init");
324 write(host.path(), "README.md", "hello\n");
325 write(host.path(), "src/lib.rs", "pub fn f() {}\n");
326 ok(
327 local.run(host.path(), &["add", "README.md", "src/lib.rs"]),
328 "add",
329 );
330 ok(
331 local.run(host.path(), &["record", "-a", "-m", "first"]),
332 "record",
333 );
334 ok(
335 local.run(host.path(), &["view", "create", "exp-1", "--from", "dev"]),
336 "view create",
337 );
338 let server = serve();
339 let env = Env {
340 home: local.home,
341 socket: Some(server.socket.clone()),
342 };
343 (server, env, host)
344}
345
346fn open(env: &Env, host: &Path, view: &str, dest: &Path) -> Value {
347 let out = ok(

Calls 7

okFunction · 0.70
writeFunction · 0.70
serveFunction · 0.70
unwrapMethod · 0.45
runMethod · 0.45
pathMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected