MCPcopy
hub / github.com/opentofu/opentofu / TestOutput_withoutShowSensitiveArg

Function TestOutput_withoutShowSensitiveArg

internal/command/output_test.go:370–397  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

368}
369
370func TestOutput_withoutShowSensitiveArg(t *testing.T) {
371 originalState := stateWithSensitiveValueForOutput()
372
373 statePath := testStateFile(t, originalState)
374
375 view, done := testView(t)
376 c := &OutputCommand{
377 Meta: Meta{
378 WorkingDir: workdir.NewDir("."),
379 testingOverrides: metaOverridesForProvider(testProvider()),
380 View: view,
381 },
382 }
383
384 args := []string{
385 "-state", statePath,
386 }
387 code := c.Run(args)
388 output := done(t)
389 if code != 0 {
390 t.Fatalf("bad: \n%s", output.Stderr())
391 }
392
393 actual := strings.TrimSpace(output.Stdout())
394 if actual != "foo = <sensitive>" {
395 t.Fatalf("bad: %#v", actual)
396 }
397}
398
399// stateWithSensitiveValueForOutput return a state with an output value
400// marked as sensitive.

Callers

nothing calls this directly

Calls 9

RunMethod · 0.95
NewDirFunction · 0.92
metaOverridesForProviderFunction · 0.85
StderrMethod · 0.80
StdoutMethod · 0.80
testStateFileFunction · 0.70
testViewFunction · 0.70
testProviderFunction · 0.70

Tested by

no test coverage detected