added explicit tests for overlay commands
Signed-off-by: Christian Goll <cgoll@suse.com>
This commit is contained in:
committed by
Jonathon Anderson
parent
7f502c1f8a
commit
5d25b3a4a6
@@ -119,6 +119,18 @@ func (env *TestEnv) WriteFile(t *testing.T, fileName string, content string) {
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
|
||||
// WriteFileAbs uses an absloute path in opposite to WriteFile
|
||||
func (env *TestEnv) WriteFileAbs(t *testing.T, fileName string, content string) {
|
||||
dirName := filepath.Dir(fileName)
|
||||
err := os.MkdirAll(dirName, 0755)
|
||||
assert.NoError(t, err)
|
||||
f, err := os.Create(fileName)
|
||||
assert.NoError(t, err)
|
||||
defer f.Close()
|
||||
_, err = f.WriteString(content)
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
|
||||
// ReadFile returns the content of fileName as converted to a
|
||||
// string.
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user