MCPcopy Create free account
hub / github.com/dallay/agentsync / test_opencode_formatter_basic

Function test_opencode_formatter_basic

src/mcp.rs:1764–1790  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1762
1763 #[test]
1764 fn test_opencode_formatter_basic() {
1765 let formatter = OpenCodeFormatter;
1766 let server = create_test_server();
1767 let servers: BTreeMap<&str, &McpServerConfig> = BTreeMap::from([("filesystem", &server)]);
1768
1769 let output = formatter.format(&servers);
1770
1771 assert_eq!(
1772 output.get("$schema").unwrap().as_str().unwrap(),
1773 "https://opencode.ai/config.json"
1774 );
1775 assert!(output.get("mcp").is_some());
1776 let mcp_servers = output.get("mcp").unwrap();
1777 let fs_server = mcp_servers.get("filesystem").unwrap();
1778
1779 // Verify OpenCode specific structure
1780 assert_eq!(fs_server.get("type").unwrap().as_str().unwrap(), "local");
1781 assert!(
1782 !fs_server
1783 .get("command")
1784 .unwrap()
1785 .as_array()
1786 .unwrap()
1787 .is_empty()
1788 );
1789 assert!(fs_server.get("enabled").unwrap().as_bool().unwrap());
1790 }
1791
1792 #[test]
1793 fn test_opencode_formatter_preserves_other_settings() {

Callers

nothing calls this directly

Calls 2

formatMethod · 0.80
create_test_serverFunction · 0.70

Tested by

no test coverage detected