package mcp import ( "testing" "time" ) func TestNewToolHandler(t *testing.T) { cfg := ToolConfig{ NATSUrl: "nats://localhost:4222", NKeyFile: "/path/to/key", AdminNKeyFile: "/path/to/admin/key", DiscoverSubject: "deploy.discover", Timeout: 10 * time.Minute, } h := NewToolHandler(cfg) if h.cfg.NATSUrl != cfg.NATSUrl { t.Errorf("NATSUrl = %q, want %q", h.cfg.NATSUrl, cfg.NATSUrl) } if h.cfg.NKeyFile != cfg.NKeyFile { t.Errorf("NKeyFile = %q, want %q", h.cfg.NKeyFile, cfg.NKeyFile) } if h.cfg.Timeout != cfg.Timeout { t.Errorf("Timeout = %v, want %v", h.cfg.Timeout, cfg.Timeout) } } func TestDeployTool(t *testing.T) { tool := DeployTool() if tool.Name != "deploy" { t.Errorf("Name = %q, want %q", tool.Name, "deploy") } if tool.Description == "" { t.Error("Description should not be empty") } } func TestDeployAdminTool(t *testing.T) { tool := DeployAdminTool() if tool.Name != "deploy_admin" { t.Errorf("Name = %q, want %q", tool.Name, "deploy_admin") } if tool.Description == "" { t.Error("Description should not be empty") } } func TestListHostsTool(t *testing.T) { tool := ListHostsTool() if tool.Name != "list_hosts" { t.Errorf("Name = %q, want %q", tool.Name, "list_hosts") } if tool.Description == "" { t.Error("Description should not be empty") } }