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

Function Test_ValidateInputCmd_NoPolicyProvided

cmd/validate/input_test.go:256–269  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

254}
255
256func Test_ValidateInputCmd_NoPolicyProvided(t *testing.T) {
257 fs := afero.NewMemMapFs()
258 require.NoError(t, afero.WriteFile(fs, "/file.yaml", []byte("some: data"), 0o644))
259
260 cmd, _ := setUpValidateInputCmd(nil, fs)
261 cmd.SetArgs([]string{
262 "input",
263 "--file", "/file.yaml",
264 })
265
266 err := cmd.Execute()
267 assert.Error(t, err)
268 assert.Contains(t, err.Error(), "required flag(s) \"policy\" not set")
269}
270
271func Test_ValidateInputCmd_NoFileProvided(t *testing.T) {
272 cmd, _ := setUpValidateInputCmd(nil, afero.NewMemMapFs())

Callers

nothing calls this directly

Calls 2

setUpValidateInputCmdFunction · 0.85
ErrorMethod · 0.65

Tested by

no test coverage detected