agent/mcp/ethics_test.go
Snider 1823893c16 feat(mcp): add marketplace server
Summary:\n- added vendor-neutral MCP stdio server with marketplace, core CLI, and ethics tools\n- implemented plugin discovery across commands and skills\n- added Good/Bad/Ugly tests and Go module dependency updates
2026-02-05 20:44:47 +00:00

37 lines
764 B
Go

package main
import (
"os"
"path/filepath"
"testing"
)
func TestEthicsCheck_Good(t *testing.T) {
root, err := findRepoRoot()
if err != nil {
t.Fatalf("expected repo root: %v", err)
}
modalPath := filepath.Join(root, ethicsModalPath)
modal, err := os.ReadFile(modalPath)
if err != nil {
t.Fatalf("expected modal to read: %v", err)
}
if len(modal) == 0 {
t.Fatalf("expected modal content")
}
axioms, err := readJSONMap(filepath.Join(root, ethicsAxiomsPath))
if err != nil {
t.Fatalf("expected axioms to read: %v", err)
}
if len(axioms) == 0 {
t.Fatalf("expected axioms data")
}
}
func TestReadJSONMap_Bad(t *testing.T) {
if _, err := readJSONMap("/missing/file.json"); err == nil {
t.Fatalf("expected error for missing json")
}
}