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

Function stale_is_stale_and_na

atomic-cli/src/commands/intent/list.rs:405–429  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

403
404 #[test]
405 fn stale_is_stale_and_na() {
406 let (repo, ids, _dir) = repo_with_intents(1);
407 let kp = KeyPair::generate();
408 let node = attest_with(&repo, &ids[0], &kp);
409 write_tracked(&repo, &ids[0], &node);
410
411 // Edit the stored intent body so the recorded source hash no longer
412 // matches ⇒ load_attestation returns Stale.
413 let path = bridge::vault_path_for(&repo, &ids[0]).unwrap().unwrap();
414 let entry = repo.vault_retrieve(&path).unwrap().unwrap();
415 let mut body = String::from_utf8_lossy(&entry.content_bytes).into_owned();
416 body.push_str("\n<!-- edited after attest -->\n");
417 repo.vault_store(
418 &path,
419 VaultEntryType::Intent,
420 body.into_bytes(),
421 entry.frontmatter_json.clone(),
422 )
423 .unwrap();
424
425 let row = row_for(&repo, &ids[0], Some(&kp));
426 assert_eq!(row.attested, Attested::Stale);
427 assert_eq!(row.verifies, Verifies::Na, "stale ⇒ verifies '–', not '✗'");
428 assert_eq!(row.attested.table(), "stale");
429 }
430
431 #[test]
432 fn tampered_same_signer_is_x() {

Callers

nothing calls this directly

Calls 9

repo_with_intentsFunction · 0.85
vault_path_forFunction · 0.85
vault_retrieveMethod · 0.80
vault_storeMethod · 0.80
attest_withFunction · 0.70
write_trackedFunction · 0.70
row_forFunction · 0.70
unwrapMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected