MCPcopy Create free account
hub / github.com/diillson/chatcli / TestReadGraphDataFile

Function TestReadGraphDataFile

cli/plugins/builtin_graphview_test.go:252–265  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

250}
251
252func TestReadGraphDataFile(t *testing.T) {
253 dir := t.TempDir()
254 path := filepath.Join(dir, "g.json")
255 if err := os.WriteFile(path, []byte(`{"nodes":[{"id":"a","label":"A"},{"id":"b","name":"B"}],"edges":[{"from":"a","to":"b"}]}`), 0o600); err != nil {
256 t.Fatalf("write: %v", err)
257 }
258 data, err := readGraphDataFile(path)
259 if err != nil {
260 t.Fatalf("read: %v", err)
261 }
262 if len(data.Nodes) != 2 || len(data.Edges) != 1 {
263 t.Fatalf("parsed = %+v", data)
264 }
265}
266
267func TestExecuteGraphViewFromFileSource(t *testing.T) {
268 dir := t.TempDir()

Callers

nothing calls this directly

Calls 1

readGraphDataFileFunction · 0.85

Tested by

no test coverage detected