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

Function setup

atomic-cli/tests/it/remote_sandbox_client_test.rs:314–341  ·  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

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