MCPcopy Create free account
hub / github.com/cozystack/talm / TestContract_Render_BadValueFileError

Function TestContract_Render_BadValueFileError

pkg/engine/contract_render_test.go:122–136  ·  view source on GitHub ↗

Contract: Render with a values file that does not exist surfaces a loadValues error naming the missing file. Confirms loadValues' errors propagate up cleanly.

(t *testing.T)

Source from the content-addressed store, hash-verified

120// loadValues error naming the missing file. Confirms loadValues'
121// errors propagate up cleanly.
122func TestContract_Render_BadValueFileError(t *testing.T) {
123 chartRoot := createTestChart(t, "tc", "config.yaml", "machine:\n type: worker\n")
124 _, err := Render(context.Background(), nil, Options{
125 Offline: true,
126 Root: chartRoot,
127 ValueFiles: []string{"/path/that/does/not/exist.yaml"},
128 TemplateFiles: []string{"templates/config.yaml"},
129 })
130 if err == nil {
131 t.Fatal("expected error for missing values file")
132 }
133 if !strings.Contains(err.Error(), "does/not/exist") {
134 t.Errorf("error must reference the missing path, got: %v", err)
135 }
136}
137
138// === Render: happy path ===
139

Callers

nothing calls this directly

Calls 3

createTestChartFunction · 0.85
ErrorMethod · 0.80
RenderFunction · 0.70

Tested by

no test coverage detected