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

Function TestRenderGraphProducesPNG

cli/graph_command_test.go:79–93  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

77}
78
79func TestRenderGraphProducesPNG(t *testing.T) {
80 if testing.Short() {
81 t.Skip("skips the go-graphviz rasterization under -short")
82 }
83 g := dotSampleGraph()
84 dot := graphToDOT(g, selectFullGraphNodes(g), "test")
85 out := filepath.Join(t.TempDir(), "graph.png")
86 if _, err := plugins.RenderDOTToFile(context.Background(), dot, "png", graphVizEngine, out, graphVizDPI); err != nil {
87 t.Fatalf("render failed: %v", err)
88 }
89 fi, err := os.Stat(out)
90 if err != nil || fi.Size() == 0 {
91 t.Fatalf("expected a non-empty PNG at %s: %v", out, err)
92 }
93}

Callers

nothing calls this directly

Calls 5

RenderDOTToFileFunction · 0.92
dotSampleGraphFunction · 0.85
graphToDOTFunction · 0.85
selectFullGraphNodesFunction · 0.85
SizeMethod · 0.45

Tested by

no test coverage detected