Make filesys walk work.

This commit is contained in:
Jeffrey Regan
2019-11-25 16:55:50 -08:00
committed by jregan
parent cb64e19da3
commit c722d4cd17
15 changed files with 1369 additions and 443 deletions

View File

@@ -37,7 +37,7 @@ func TestCreateNoArgs(t *testing.T) {
}
func TestCreateWithResources(t *testing.T) {
fSys := filesys.MakeFsInMemory()
fSys := filesys.MakeEmptyDirInMemory()
fSys.WriteFile("foo.yaml", []byte(""))
fSys.WriteFile("bar.yaml", []byte(""))
opts := createFlags{resources: "foo.yaml,bar.yaml"}

View File

@@ -20,7 +20,7 @@ sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
)
func TestAddPatchHappyPath(t *testing.T) {
fSys := filesys.MakeFsInMemory()
fSys := filesys.MakeEmptyDirInMemory()
fSys.WriteFile(patchFileName, []byte(patchFileContent))
fSys.WriteFile(patchFileName+"another", []byte(patchFileContent))
testutils_test.WriteTestKustomization(fSys)
@@ -44,7 +44,7 @@ func TestAddPatchHappyPath(t *testing.T) {
}
func TestAddPatchAlreadyThere(t *testing.T) {
fSys := filesys.MakeFsInMemory()
fSys := filesys.MakeEmptyDirInMemory()
fSys.WriteFile(patchFileName, []byte(patchFileContent))
testutils_test.WriteTestKustomization(fSys)
@@ -63,7 +63,7 @@ func TestAddPatchAlreadyThere(t *testing.T) {
}
func TestAddPatchNoArgs(t *testing.T) {
fSys := filesys.MakeFsInMemory()
fSys := filesys.MakeEmptyDirInMemory()
cmd := newCmdAddPatch(fSys)
err := cmd.Execute()

View File

@@ -20,7 +20,7 @@ sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
)
func TestAddResourceHappyPath(t *testing.T) {
fSys := filesys.MakeFsInMemory()
fSys := filesys.MakeEmptyDirInMemory()
fSys.WriteFile(resourceFileName, []byte(resourceFileContent))
fSys.WriteFile(resourceFileName+"another", []byte(resourceFileContent))
testutils_test.WriteTestKustomization(fSys)

View File

@@ -73,7 +73,7 @@ func TestDataConfigValidation_Flags(t *testing.T) {
}
func TestExpandFileSource(t *testing.T) {
fSys := filesys.MakeFsInMemory()
fSys := filesys.MakeEmptyDirInMemory()
fSys.Create("dir/fa1")
fSys.Create("dir/fa2")
fSys.Create("dir/readme")
@@ -91,7 +91,7 @@ func TestExpandFileSource(t *testing.T) {
}
func TestExpandFileSourceWithKey(t *testing.T) {
fSys := filesys.MakeFsInMemory()
fSys := filesys.MakeEmptyDirInMemory()
fSys.Create("dir/faaaaaaaaaabbbbbbbbbccccccccccccccccc")
fSys.Create("dir/foobar")
fSys.Create("dir/simplebar")

View File

@@ -21,7 +21,7 @@ sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
)
func makeKustomizationPatchFS() filesys.FileSystem {
fSys := filesys.MakeFsInMemory()
fSys := filesys.MakeEmptyDirInMemory()
patches := []string{"patch1.yaml", "patch2.yaml"}
testutils_test.WriteTestKustomizationWith(fSys, []byte(