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

Source from the content-addressed store, hash-verified

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