mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-07-17 17:52:12 +00:00
Merge pull request #2510 from monopole/makeTestMoreRelocatable
Make a test more relocatable.
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"sigs.k8s.io/kustomize/api/filesys"
|
"sigs.k8s.io/kustomize/api/filesys"
|
||||||
|
"sigs.k8s.io/kustomize/api/konfig"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestDeterminePluginSrcRoot(t *testing.T) {
|
func TestDeterminePluginSrcRoot(t *testing.T) {
|
||||||
@@ -19,8 +20,7 @@ func TestDeterminePluginSrcRoot(t *testing.T) {
|
|||||||
if !filepath.IsAbs(actual) {
|
if !filepath.IsAbs(actual) {
|
||||||
t.Errorf("expected absolute path, but got '%s'", actual)
|
t.Errorf("expected absolute path, but got '%s'", actual)
|
||||||
}
|
}
|
||||||
expectedSuffix := filepath.Join("sigs.k8s.io", "kustomize", "plugin")
|
if !strings.HasSuffix(actual, konfig.RelPluginHome) {
|
||||||
if !strings.HasSuffix(actual, expectedSuffix) {
|
t.Errorf("expected suffix '%s' in '%s'", konfig.RelPluginHome, actual)
|
||||||
t.Errorf("expected suffix '%s' in '%s'", expectedSuffix, actual)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user