(t *testing.T)
| 297 | } |
| 298 | |
| 299 | func Test_ValidateInputCmd_EmptyPolicyFile(t *testing.T) { |
| 300 | fs := afero.NewMemMapFs() |
| 301 | require.NoError(t, afero.WriteFile(fs, "/file.yaml", []byte("data"), 0o644)) |
| 302 | require.NoError(t, afero.WriteFile(fs, "/policy.yaml", []byte{}, 0o644)) |
| 303 | |
| 304 | cmd, _ := setUpValidateInputCmd(nil, fs) |
| 305 | cmd.SetArgs([]string{ |
| 306 | "input", |
| 307 | "--file", "/file.yaml", |
| 308 | "--policy", "/policy.yaml", |
| 309 | }) |
| 310 | |
| 311 | err := cmd.Execute() |
| 312 | assert.Error(t, err) |
| 313 | assert.Contains(t, err.Error(), "file /policy.yaml is empty") |
| 314 | } |
| 315 | |
| 316 | func Test_ValidateInputCmd_ShowWarningsFlag(t *testing.T) { |
| 317 | // Create a validator that returns warnings |
nothing calls this directly
no test coverage detected