MCPcopy Create free account
hub / github.com/conforma/cli / mockValidate

Function mockValidate

cmd/validate/input_test.go:43–48  ·  view source on GitHub ↗

mockValidate is a helper function that returns a specified Output and error for testing.

(out *output.Output, err error)

Source from the content-addressed store, hash-verified

41
42// mockValidate is a helper function that returns a specified Output and error for testing.
43func mockValidate(out *output.Output, err error) InputValidationFunc {
44 return func(_ context.Context, fpath string, _ policy.Policy, _ bool) (*output.Output, error) {
45 // This function ignores the actual file content and always returns the provided output and error.
46 return out, err
47 }
48}
49
50func setUpValidateInputCmd(validate InputValidationFunc, fs afero.Fs) (*cobra.Command, *bytes.Buffer) {
51 // Create the parent validate command to get the persistent flags

Calls

no outgoing calls

Tested by

no test coverage detected