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

Function test_init_vault

atomic-repository/src/repository/vault.rs:1609–1630  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1607
1608 #[test]
1609 fn test_init_vault() {
1610 let dir = tempdir().unwrap();
1611 let repo = Repository::init(dir.path()).unwrap();
1612
1613 // Vault should not exist yet
1614 assert!(!repo.has_vault().unwrap());
1615 assert!(!repo.vault_dir().exists());
1616
1617 // Initialize vault
1618 repo.init_vault().unwrap();
1619
1620 // Vault should now exist
1621 assert!(repo.has_vault().unwrap());
1622 assert!(repo.vault_dir().exists());
1623
1624 // Subdirectories should exist
1625 assert!(repo.vault_dir().join("goals").exists());
1626 assert!(repo.vault_dir().join("memory").exists());
1627 assert!(repo.vault_dir().join("skills").exists());
1628 assert!(repo.vault_dir().join("intents").exists());
1629 assert!(repo.vault_dir().join("scratch").exists());
1630 }
1631
1632 #[test]
1633 fn test_ensure_vault_initializes_once() {

Callers

nothing calls this directly

Calls 4

initFunction · 0.50
unwrapMethod · 0.45
pathMethod · 0.45
init_vaultMethod · 0.45

Tested by

no test coverage detected