1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-07 00:17:13 +00:00
kyverno/cmd/cli/kubectl-kyverno/commands/create/command_test.go
Charles-Edouard Brétéché d24b0848a6
chore: add cli commands unit tests (#8366)
* chore: add cli unit tests

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* chore: add cli commands unit tests

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-09-12 21:47:03 +00:00

22 lines
359 B
Go

package create
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestCommand(t *testing.T) {
cmd := Command()
assert.NotNil(t, cmd)
err := cmd.Execute()
assert.NoError(t, err)
}
func TestCommandWithArgs(t *testing.T) {
cmd := Command()
assert.NotNil(t, cmd)
cmd.SetArgs([]string{"foo"})
err := cmd.Execute()
assert.Error(t, err)
}