mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-05 23:46:56 +00:00
* feat: add cli values schema Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> * docs Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> * makefile Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> * v1alpha1 Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> * codegen Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> * nits Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> --------- Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
45 lines
788 B
Go
45 lines
788 B
Go
package test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/go-git/go-billy/v5"
|
|
"github.com/kyverno/kyverno/cmd/cli/kubectl-kyverno/apis/v1alpha1"
|
|
)
|
|
|
|
func TestTestCase_Dir(t *testing.T) {
|
|
type fields struct {
|
|
}
|
|
tests := []struct {
|
|
name string
|
|
Path string
|
|
Fs billy.Filesystem
|
|
Test *v1alpha1.Test
|
|
Err error
|
|
want string
|
|
}{{
|
|
name: "empty",
|
|
want: ".",
|
|
}, {
|
|
name: "relative",
|
|
Path: "foo/bar/baz.yaml",
|
|
want: "foo/bar",
|
|
}, {
|
|
name: "absolute",
|
|
Path: "/foo/bar/baz.yaml",
|
|
want: "/foo/bar",
|
|
}}
|
|
for _, tt := range tests {
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
tc := TestCase{
|
|
Path: tt.Path,
|
|
Fs: tt.Fs,
|
|
Test: tt.Test,
|
|
Err: tt.Err,
|
|
}
|
|
if got := tc.Dir(); got != tt.want {
|
|
t.Errorf("TestCase.Dir() = %v, want %v", got, tt.want)
|
|
}
|
|
})
|
|
}
|
|
}
|