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

Function test_install_creates_plugin_files

atomic-agent/src/hooks/agy.rs:1517–1548  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1515
1516 #[test]
1517 fn test_install_creates_plugin_files() {
1518 let config = temp_config();
1519
1520 let count = AgyHook::install_to(config.path(), false).unwrap();
1521 assert_eq!(count, 3);
1522
1523 let hooks_path = config.path().join("plugins/atomic/hooks.json");
1524 let manifest_path = config.path().join("plugins/atomic/plugin.json");
1525 let registry_path = config.path().join("import_manifest.json");
1526
1527 assert!(hooks_path.exists());
1528 assert!(manifest_path.exists());
1529 assert!(registry_path.exists());
1530
1531 let content = std::fs::read_to_string(&hooks_path).unwrap();
1532 assert!(content.contains(ATOMIC_HOOK_PREFIX));
1533 assert!(content.contains("pre-invocation"));
1534 assert!(content.contains("stop"));
1535 assert!(content.contains("post-tool-use"));
1536
1537 let plugin_manifest = std::fs::read_to_string(&manifest_path).unwrap();
1538 assert!(plugin_manifest.contains("\"atomic\""));
1539
1540 let registry: Value =
1541 serde_json::from_str(&std::fs::read_to_string(&registry_path).unwrap()).unwrap();
1542 let imports = registry["imports"].as_array().unwrap();
1543 assert_eq!(imports.len(), 1);
1544 assert_eq!(imports[0]["name"], "atomic");
1545 let components = imports[0]["components"].as_array().unwrap();
1546 assert!(components.iter().any(|c| c == "hooks"));
1547 assert!(components.iter().any(|c| c == "skills"));
1548 }
1549
1550 #[test]
1551 fn test_install_bundles_skills() {

Callers

nothing calls this directly

Calls 3

temp_configFunction · 0.85
unwrapMethod · 0.45
pathMethod · 0.45

Tested by

no test coverage detected