(validate InputValidationFunc, fs afero.Fs)
| 48 | } |
| 49 | |
| 50 | func setUpValidateInputCmd(validate InputValidationFunc, fs afero.Fs) (*cobra.Command, *bytes.Buffer) { |
| 51 | // Create the parent validate command to get the persistent flags |
| 52 | validateCmd := NewValidateCmd() |
| 53 | cmd := validateInputCmd(validate) |
| 54 | validateCmd.AddCommand(cmd) |
| 55 | |
| 56 | // Create a fake client and context with a memory filesystem. |
| 57 | client := fake.FakeClient{} |
| 58 | ctx := utils.WithFS(context.Background(), fs) |
| 59 | ctx = oci.WithClient(ctx, &client) |
| 60 | validateCmd.SetContext(ctx) |
| 61 | |
| 62 | var out bytes.Buffer |
| 63 | validateCmd.SetOut(&out) |
| 64 | |
| 65 | return validateCmd, &out |
| 66 | } |
| 67 | |
| 68 | func Test_ValidateInputCmd_SuccessSingleFile(t *testing.T) { |
| 69 | fs := afero.NewMemMapFs() |
no test coverage detected