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:516–540  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

514
515 #[test]
516 fn stale_is_stale_and_na() {
517 let (repo, ids, _dir) = repo_with_intents(1);
518 let kp = KeyPair::generate();
519 let node = attest_with(&repo, &ids[0], &kp);
520 write_tracked(&repo, &ids[0], &node);
521
522 // Edit the stored intent body so the recorded source hash no longer
523 // matches ⇒ load_attestation returns Stale.
524 let path = bridge::vault_path_for(&repo, &ids[0]).unwrap().unwrap();
525 let entry = repo.vault_retrieve(&path).unwrap().unwrap();
526 let mut body = String::from_utf8_lossy(&entry.content_bytes).into_owned();
527 body.push_str("\n<!-- edited after attest -->\n");
528 repo.vault_store(
529 &path,
530 VaultEntryType::Intent,
531 body.into_bytes(),
532 entry.frontmatter_json.clone(),
533 )
534 .unwrap();
535
536 let row = row_for(&repo, &ids[0], Some(&kp));
537 assert_eq!(row.attested, Attested::Stale);
538 assert_eq!(row.verifies, Verifies::Na, "stale ⇒ verifies '–', not '✗'");
539 assert_eq!(row.attested.table(), "stale");
540 }
541
542 #[test]
543 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