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

Function Test_ValidatePolicyCmd

cmd/validate/policy_test.go:29–48  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

27)
28
29func Test_ValidatePolicyCmd(t *testing.T) {
30 validate := func(ctx context.Context, policyConfiguration string) error {
31 // Mock implementation of the validate function
32 return nil
33 }
34
35 cmd := ValidatePolicyCmd(validate)
36
37 t.Run("PreRunE", func(t *testing.T) {
38 // Test PreRunE function
39 err := cmd.PreRunE(cmd, []string{})
40 assert.NoError(t, err)
41 })
42
43 t.Run("RunE", func(t *testing.T) {
44 // Test RunE function
45 err := cmd.RunE(cmd, []string{})
46 assert.NoError(t, err)
47 })
48}
49
50func Test_ValidatePolicyErrors(t *testing.T) {
51 validate := func(ctx context.Context, policyConfiguration string) error {

Callers

nothing calls this directly

Calls 2

ValidatePolicyCmdFunction · 0.85
RunMethod · 0.65

Tested by

no test coverage detected