mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-10 08:20:59 +00:00
Make plugin utils package.
This commit is contained in:
26
api/internal/plugins/utils/utils_test.go
Normal file
26
api/internal/plugins/utils/utils_test.go
Normal file
@@ -0,0 +1,26 @@
|
||||
// Copyright 2020 The Kubernetes Authors.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package utils
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"sigs.k8s.io/kustomize/api/filesys"
|
||||
"sigs.k8s.io/kustomize/api/konfig"
|
||||
)
|
||||
|
||||
func TestDeterminePluginSrcRoot(t *testing.T) {
|
||||
actual, err := DeterminePluginSrcRoot(filesys.MakeFsOnDisk())
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
if !filepath.IsAbs(actual) {
|
||||
t.Errorf("expected absolute path, but got '%s'", actual)
|
||||
}
|
||||
if !strings.HasSuffix(actual, konfig.RelPluginHome) {
|
||||
t.Errorf("expected suffix '%s' in '%s'", konfig.RelPluginHome, actual)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user